@hazae41/keccak256
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Keccak256

Keccak-256 adapter for WebAssembly and JS implementations

npm i @hazae41/keccak256

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies

Getting started

Morax (WebAssembly)

npm i @hazae41/morax
import { Keccak256 } from "@hazae41/keccak256"

Keccak256.set(await Keccak256.fromMorax())

Noble (JavaScript)

npm i @noble/hashes
import { Keccak256 } from "@hazae41/keccak256"

Keccak256.set(Keccak256.fromNoble())

Usage

Direct

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

Incremental

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

Package Sidebar

Install

npm i @hazae41/keccak256

Weekly Downloads

5

Version

1.0.8

License

MIT

Unpacked Size

93.8 kB

Total Files

36

Last publish

Collaborators

  • hazae41