Ripemd
Extends:
src/hasher/hasher32le.js~Hasher32le → Ripemd
Calculates RIPEMD-160 (RIPEMD-128, RIPEMD-256, RIPEMD-320) hash
Example:
Calculates RIPEMD-160 hash from string "message" - ES6 style
import Ripemd from "crypto-api/src/hasher/ripemd";
import {toHex} from "crypto-api/src/encoder/hex";
let hasher = new Ripemd();
hasher.update('message');
console.log(toHex(hasher.finalize()));
Calculates RIPEMD-160 hash from UTF string "message" - ES6 style
import Ripemd from "crypto-api/src/hasher/ripemd";
import {toHex} from "crypto-api/src/encoder/hex";
import {fromUtf} from "crypto-api/src/encoder/utf";
let hasher = new Ripemd();
hasher.update(fromUtf('message'));
console.log(toHex(hasher.finalize()));
Calculates RIPEMD-160 hash from string "message" - ES5 style
<script src="https://nf404.github.io/crypto-api/crypto-api.min.js"></script>
<script>
var hasher = CryptoApi.getHasher('ripemd160');
hasher.update('message');
console.log(CryptoApi.encoder.toHex(hasher.finalize()));
</script>
Calculates RIPEMD-160 hash from UTF string "message" - ES5 style
<script src="https://nf404.github.io/crypto-api/crypto-api.min.js"></script>
<script>
console.log(CryptoApi.hash('ripemd160', 'message'));
</script>
Constructor Summary
| Public Constructor | ||
| public |
constructor(options: Object) |
|
Method Summary
| Public Methods | ||
| public |
finalize(): string Finalize hash and return result |
|
| public |
reset() Reset hasher to initial state |
|
Public Constructors
public constructor(options: Object) source
Params:
| Name | Type | Attribute | Description | ||||||||||
| options | Object |
|
|||||||||||
| options.length | number |
|
Length of hash result
|
