blake3-wasm-vn
v1.0.1
Published
Blake3 for WebAssembly
Maintainers
Readme
blake3-wasm-vn
Node.js
const { hash, hashToHex, keyedHash, verifyKeyedHash, deriveKey, deriveKeyHex } = require('blake3-wasm-vn/nodejs');
Deno
import { hash, hashToHex, keyedHash, verifyKeyedHash, deriveKey, deriveKeyHex }s from 'blake3-wasm-vn/deno';
Browser
import init, { hash, hashToHex, keyedHash, verifyKeyedHash, deriveKey, deriveKeyHex } from 'blake3-wasm-vn/web';
await init();
// Classic
const data = new TextEncoder().encode("hello world");
console.log("hash 32 bytes: ", hash(data));
console.log("hash 32 bytes (hex): ", hashToHex(data));Benchmark
| (index) | Task name | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples | |---------|--------------------|------------------|------------------|------------------------|------------------------|---------| | 0 | 'hash - 32 bytes' | '3456.0 ± 4.31%' | '0.00 ± 0.00' | '279710 ± 0.15%' | '289355 ± 0' | 57900 | | 1 | 'hash - 64 bytes' | '3652.7 ± 4.31%' | '0.00 ± 0.00' | '264148 ± 0.16%' | '273768 ± 0' | 54781 | | 2 | 'hash - 128 bytes' | '4004.5 ± 4.30%' | '0.00 ± 0.00' | '240125 ± 0.17%' | '249720 ± 0' | 49969 |
