JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 109
  • Score
    100M100P100Q62317F
  • License MIT

An universal JavaScript ripemd160 message digest function.

Package Exports

  • ripemd160-js
  • ripemd160-js/package
  • ripemd160-js/package.json

Readme

RIPEMD1600 logo

ripemd160-js

NPM Package CI status License: MIT

A RIPEMD160 cryptographic hash function for Universal JavaScript.

This package has adapted Trezor’s RIPEMD160 and compiled it to a stand-alone WebAssembly file that can be readily consumed by browsers and Node.js.

Please see my wasm-ripemd160 code repo on how to achieve this.

Setup

$ npm i ripemd160-js

Support

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”