@philiprehberger/hash-kit
v0.1.5
Published
Simple cross-platform hashing utilities
Readme
@philiprehberger/hash-kit
Simple cross-platform hashing utilities
Installation
npm install @philiprehberger/hash-kitUsage
import { hash } from '@philiprehberger/hash-kit';
const checksum = hash.murmur3('cache-key'); // sync, fast
const digest = await hash.sha256('hello'); // cross-platform
const sig = await hash.hmac(secret, payload, 'SHA-256'); // HMACAPI
| Function | Description |
|----------|-------------|
| hash.murmur3(input, seed?) | MurmurHash3 (sync) |
| hash.sha256(input) | SHA-256 via Web Crypto |
| hash.sha512(input) | SHA-512 via Web Crypto |
| hash.hmac(key, data, algorithm?) | HMAC signing |
| toHex(buffer) | ArrayBuffer to hex string |
| toUint8Array(input) | String to Uint8Array |
Development
npm install
npm run build
npm testSupport
If you find this project useful:
