@webbuf/ripemd160
v4.0.1
Published
Rust/wasm optimized ripemd160 hash & mac for the web, node.js, deno, and bun.
Maintainers
Readme
@webbuf/ripemd160
WebBuf 4 byte access
Public inputs and outputs retain WebBuf/FixedBuf wrapper types. Use
value.bytes (WebBuf) or value.buf.bytes (FixedBuf) when calling native
array APIs yourself. This package unwraps selected byte views at its WASM
boundary; algorithms, output formats and existing input/output ownership
remain unchanged. Nonzero-offset views are supported without copying inputs.
RIPEMD-160 cryptographic hash, optimized with Rust/WASM.
Installation
npm install @webbuf/ripemd160Usage
import { ripemd160Hash, doubleRipemd160Hash } from "@webbuf/ripemd160";
import { WebBuf } from "@webbuf/webbuf";
// RIPEMD-160 hash
const data = WebBuf.fromUtf8("Hello, world!");
const hash = ripemd160Hash(data);
console.log(hash.toHex()); // 20-byte hash
// Double hash (hash of hash)
const doubleHash = doubleRipemd160Hash(data);API
| Function | Description |
| ------------------------------------------------- | ----------------------- |
| ripemd160Hash(data: WebBuf): FixedBuf<20> | Compute RIPEMD-160 hash |
| doubleRipemd160Hash(data: WebBuf): FixedBuf<20> | Compute hash of hash |
License
MIT
