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