1.0.2 • Published 7 months ago

@hazae41/ripemd160 v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Ripemd160

RIPEMD-160 adapter for WebAssembly and JS implementations

npm i @hazae41/ripemd160

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies

Getting started

Morax (WebAssembly)

npm i @hazae41/morax
import { Ripemd160 } from "@hazae41/ripemd160"

Ripemd160.set(await Ripemd160.fromMorax())

Noble (JavaScript)

npm i @noble/hashes
import { Ripemd160 } from "@hazae41/ripemd160"

Ripemd160.set(Ripemd160.fromNoble())

Usage

Direct

const hashed: Uint8Array = Ripemd160.get().tryHash(new Uint8Array([1,2,3,4,5])).unwrap().copyAndDispose()

Incremental

const hasher = Ripemd160.get().Hasher.tryNew().unwrap()
hasher.tryUpdate(new Uint8Array([1,2,3,4,5])).unwrap()
const hashed: Uint8Array = hasher.tryFinalize().unwrap().copyAndDispose()