1.0.0 • Published 3 years ago
ripemd160-js-rc v1.0.0
ripemd160-js
A Universal JavaScript RIPEMD160 function for
Adapted from trezor ripemd160
Setup
$ npm i ripemd160-js
Support
- Node.js
>= 8
- Browser list
defaults
not IE 11
.
API
Table of contents
function ripemd160
Performs the message digest algorithm RIPEMD160 on input data.
Parameter | Type | Description |
---|---|---|
message | string | Uint8Array | Data to hash. |
Returns: string | Uint8Array — Preserves the data return type.
Examples
Ways to import
.
import ripemd160 from 'ripemd160-js'
Ways to require
.
const ripemd160 = require('ripemd160-js')
Usage Sting
ripemd160
.
ripemd160('hello').then(console.log)
The logged output will be “108f07b8382412612c048d07d13f814118445acd”.
Usage Uint8Array
ripemd160
.
const print_hex = array => Buffer.from(array).toString('hex') ripemd160(new Uint8Array([1, 2, 3])).then(print_hex)
The logged output will be “79f901da2609f020adadbf2e5f68a16c8c3f7d57”
1.0.0
3 years ago