1.0.0 • Published 4 years ago

ripemd160-js-rc v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

RIPEMD1600 logo

ripemd160-js

A Universal JavaScript RIPEMD160 function for

Adapted from trezor ripemd160

Setup

$ npm i ripemd160-js

Support

API

Table of contents

function ripemd160

Performs the message digest algorithm RIPEMD160 on input data.

ParameterTypeDescription
messagestring | Uint8ArrayData 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”