Hashing & KDF

@webbuf/sha1

Synchronous Rust/WASM SHA-1 for legacy protocol interoperability.

Install

npm install @webbuf/sha1

Usage

import { WebBuf } from "@webbuf/webbuf";
import { sha1Hash } from "@webbuf/sha1";
const digest = sha1Hash(WebBuf.fromUtf8("abc"));
console.log(digest.toHex()); // a9993e364706816aba3e25717850c26c9cd0d89d

API reference (1 export)

Functions

sha1Hash

function

Synchronous SHA-1 for legacy protocols only, not collision-resistant security. Hashes selected bytes; input is unchanged and output owns independent storage.

sha1Hash(buf: WebBuf): FixedBuf<20>