feat: multi-target build + CI + publish workflow

This commit is contained in:
2026-04-22 18:32:07 +02:00
parent 95e1a30467
commit 9c3d538470
8 changed files with 537 additions and 6 deletions
+25 -1
View File
@@ -23,8 +23,32 @@ rustflags = ["-C", "target-feature=+simd128"]
## Usage
```ts
import * as blake3 from 'blake3-wasm-rs';
const data = new TextEncoder().encode('hello world');
const key = new Uint8Array(32).fill(1);
// One-shot hashing
blake3.hash(data);
blake3.hashXof(data, 64); // variable output length
// MAC and key derivation
blake3.keyedHash(data, key);
blake3.deriveKey('my context', key);
// Conctruct for streaming
const hasher = new blake3.Hasher();
hasher.update(data.slice(0, 5));
hasher.update(data.slice(5));
hasher.finalize();
```
#### OR
```js
import { hash, hashXof, keyedHash, deriveKey, Hasher } from './pkg/blake3_wasm.js'
import { hash, hashXof, keyedHash, deriveKey, Hasher } from 'blake3-wasm-rs'
const data = new TextEncoder().encode('hello world')
const key = new Uint8Array(32).fill(1)