SHA-1 adapter for WebAssembly and JS implementations
npm i @hazae41/sha1
- 100% TypeScript and ESM
- No external dependencies
npm i @hazae41/morax
import { Sha1 } from "@hazae41/sha1"
Sha1.set(await Sha1.fromMorax())
npm i @noble/hashes
import { Sha1 } from "@hazae41/sha1"
Sha1.set(Sha1.fromNoble())
const hashed: Uint8Array = Sha1.get().tryHash(new Uint8Array([1,2,3,4,5])).unwrap().copyAndDispose()
const hasher = Sha1.get().Hasher.tryNew().unwrap()
hasher.tryUpdate(new Uint8Array([1,2,3,4,5])).unwrap()
const hashed: Uint8Array = hasher.tryFinalize().unwrap().copyAndDispose()