{"_id":"blake3-jit","_rev":"3-0a00cf93909bca4d7c46b209a8311f40","name":"blake3-jit","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0":{"name":"blake3-jit","version":"0.0.0","keywords":["blake3","hash","crypto","simd","wasm","fast"],"author":{"name":"LongYinan","email":"github@lyn.one"},"license":"MIT","_id":"blake3-jit@0.0.0","maintainers":[{"name":"broooooklyn","email":"lynweklm@gmail.com"}],"dist":{"shasum":"849e70db10e2f859007020b5d2f93198052599a3","tarball":"https://registry.npmjs.org/blake3-jit/-/blake3-jit-0.0.0.tgz","fileCount":6,"integrity":"sha512-2MtrbDI1PGNTk0sT9gYjmPCpkPqkI0Pcg+Rw9tpbKbH5cZfJ3TsbztzXGYaC1v28X0h6E2bIL16KLGBesYlxqw==","signatures":[{"sig":"MEQCIGVP8gqIbfpWISL9etvwEMHiQuNmmoSQ6RGTgC2zVoLXAiBH3//1ChZ0wBrDd0bnqybNYM1fbOIzg3RRcBw5q5u3ow==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":286069},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","funding":{"url":"https://github.com/sponsors/Brooooooklyn","type":"github"},"gitHead":"09b6ad0e1223138343864f1bd96e36179d5f44c7","scripts":{"lint":"oxlint --type-aware .","test":"vitest run","bench":"oxnode bench/benchmark.ts","build":"rolldown -c rolldown.config.js","format":"oxfmt","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"broooooklyn","email":"lynweklm@gmail.com"},"_npmVersion":"11.6.2","description":"The pure JavaScript BLAKE3 implementation with runtime WASM SIMD","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"packageManager":"yarn@4.12.0","devDependencies":{"oxfmt":"^0.17.0","oxlint":"^1.32.0","vitest":"^4.0.15","rolldown":"1.0.0-beta.53","typescript":"^5.9.3","@types/node":"^24.10.2","@oxc-node/cli":"^0.0.35","oxlint-tsgolint":"^0.8.4","@napi-rs/blake-hash":"1.3.6","rolldown-plugin-dts":"^0.18.3"},"_npmOperationalInternal":{"tmp":"tmp/blake3-jit_0.0.0_1765380239820_0.6448184843153089","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"blake3-jit","version":"1.0.0","keywords":["blake3","hash","crypto","simd","wasm","fast"],"author":{"name":"LongYinan","email":"github@lyn.one"},"license":"MIT","_id":"blake3-jit@1.0.0","maintainers":[{"name":"broooooklyn","email":"lynweklm@gmail.com"}],"homepage":"https://github.com/Brooooooklyn/blake3-jit#readme","bugs":{"url":"https://github.com/Brooooooklyn/blake3-jit/issues"},"dist":{"shasum":"e98dafa7ddd6be62e1ddd9dcf0ec2051523bb8eb","tarball":"https://registry.npmjs.org/blake3-jit/-/blake3-jit-1.0.0.tgz","fileCount":6,"integrity":"sha512-0Ulza5lYejLqATjvLKlNlsEbDGclbN4bbPzAImemeApmnihTf9ERQOQg018hpKw2xbrweT/1WEZ0OEeFkvjhuQ==","signatures":[{"sig":"MEYCIQDbG2YhkmbB7bxuUYa/x3yEkW27+lP7vrPrL6yYqxL09AIhAKasDUufrQ3GVAUANhygYKfJ0SkXbDYUCNANDSMp67fH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/blake3-jit@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":286175},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","funding":{"url":"https://github.com/sponsors/Brooooooklyn","type":"github"},"gitHead":"d6959c8106abbb1346deeb052bc0f09c028ca78c","scripts":{"lint":"oxlint --type-aware .","test":"vitest run","bench":"oxnode bench/benchmark.ts","build":"rolldown -c rolldown.config.js","format":"oxfmt","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:965eddab-cd1a-478c-9376-e23f505b60e9"}},"repository":{"url":"git+https://github.com/Brooooooklyn/blake3-jit.git","type":"git"},"_npmVersion":"11.7.0","description":"The pure JavaScript BLAKE3 implementation with runtime WASM SIMD","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"packageManager":"yarn@4.12.0","devDependencies":{"oxfmt":"^0.17.0","oxlint":"^1.32.0","vitest":"^4.0.15","rolldown":"1.0.0-beta.53","typescript":"^5.9.3","@types/node":"^24.10.2","@oxc-node/cli":"^0.0.35","oxlint-tsgolint":"^0.8.4","@napi-rs/blake-hash":"1.3.6","rolldown-plugin-dts":"^0.18.3"},"_npmOperationalInternal":{"tmp":"tmp/blake3-jit_1.0.0_1765381184080_0.4902385856741063","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"blake3-jit","version":"1.1.0","description":"The pure JavaScript BLAKE3 implementation with runtime WASM SIMD","keywords":["blake3","crypto","fast","hash","simd","wasm"],"license":"MIT","author":{"name":"LongYinan","email":"github@lyn.one"},"repository":{"type":"git","url":"git+https://github.com/Brooooooklyn/blake3-jit.git"},"funding":{"type":"github","url":"https://github.com/sponsors/Brooooooklyn"},"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"rolldown -c rolldown.config.js","test":"vitest run","lint":"oxlint --type-aware .","format":"oxfmt","bench":"oxnode bench/benchmark.ts","typecheck":"tsc -p tsconfig.json"},"devDependencies":{"@huggingface/blake3-wasm":"^0.0.4","@napi-rs/blake-hash":"1.3.6","@oxc-node/cli":"^0.1.0","@types/node":"^25.0.3","oxfmt":"^0.45.0","oxlint":"^1.36.0","oxlint-tsgolint":"^0.21.0","rolldown":"1.0.0-rc.16","rolldown-plugin-dts":"^0.23.0","typescript":"^6.0.0","vitest":"^4.0.16"},"packageManager":"yarn@4.14.1","gitHead":"f683aa76fa4dc5d87f3c54126fef75ddc9cd953e","_id":"blake3-jit@1.1.0","bugs":{"url":"https://github.com/Brooooooklyn/blake3-jit/issues"},"homepage":"https://github.com/Brooooooklyn/blake3-jit#readme","_nodeVersion":"24.14.1","_npmVersion":"11.12.1","dist":{"integrity":"sha512-5lNvUdIw2roA6LSV39E1mDXN8WVK8kC0dGZtaZoErkVktSgUjgRueTv4WVqHIUMHGerkfhxBuqFtMNuo/GdLrA==","shasum":"bad8d86d0fb658847824b69c777bb9c7a9418047","tarball":"https://registry.npmjs.org/blake3-jit/-/blake3-jit-1.1.0.tgz","fileCount":6,"unpackedSize":286033,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/blake3-jit@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCInZFVVHP50AvmIApQkoz/r5gAu+sSamzI364d8tNZqwIhAOYQ/PuHXu8sCDscWRsi3HnPZoTudQSFJFchKCV9sj+S"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:965eddab-cd1a-478c-9376-e23f505b60e9"}},"directories":{},"maintainers":[{"name":"broooooklyn","email":"lynweklm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/blake3-jit_1.1.0_1776422150845_0.5834064360340769"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-10T15:23:59.819Z","modified":"2026-04-17T10:35:51.497Z","0.0.0":"2025-12-10T15:23:59.968Z","1.0.0":"2025-12-10T15:39:44.233Z","1.1.0":"2026-04-17T10:35:51.103Z"},"bugs":{"url":"https://github.com/Brooooooklyn/blake3-jit/issues"},"author":{"name":"LongYinan","email":"github@lyn.one"},"license":"MIT","homepage":"https://github.com/Brooooooklyn/blake3-jit#readme","keywords":["blake3","crypto","fast","hash","simd","wasm"],"repository":{"type":"git","url":"git+https://github.com/Brooooooklyn/blake3-jit.git"},"description":"The pure JavaScript BLAKE3 implementation with runtime WASM SIMD","maintainers":[{"name":"broooooklyn","email":"lynweklm@gmail.com"}],"readme":"# blake3-jit\n\n[![CI](https://github.com/Brooooooklyn/blake3-jit/actions/workflows/ci.yml/badge.svg)](https://github.com/Brooooooklyn/blake3-jit/actions/workflows/ci.yml)\n\nHigh-performance BLAKE3 implementation with runtime JIT WASM SIMD.\n\n## Features\n\n- **1.38 GB/s** peak throughput on large inputs\n- **Pure JS + JIT WASM SIMD** - no `.wasm` files to ship\n- All BLAKE3 modes: hash, keyed (MAC), derive_key\n- XOF (eXtendable Output Function) support\n- Zero dependencies, tree-shakeable\n\n## Installation\n\n```bash\nnpm install blake3-jit\n```\n\n## Usage\n\n```typescript\nimport { hash, createHasher, createKeyed, createDeriveKey } from \"blake3-jit\";\n\n// One-shot hashing\nconst digest = hash(new Uint8Array([1, 2, 3]));\n\n// Incremental hashing\nconst hasher = createHasher();\nhasher.update(chunk1);\nhasher.update(chunk2);\nconst result = hasher.finalize();\n\n// Keyed hashing (MAC)\nconst mac = createKeyed(key).update(message).finalize();\n\n// Key derivation\nconst derived = createDeriveKey(\"my-app v1\").update(material).finalize(32);\n```\n\n## API\n\n### One-shot Functions\n\n```typescript\nhash(input: Uint8Array, outputLength?: number): Uint8Array\nhashInto(input: Uint8Array, output: Uint8Array, outputLength?: number): void\n```\n\n### Incremental Hashing\n\n```typescript\ncreateHasher(): Hasher\ncreateKeyed(key: Uint8Array): Hasher    // 32-byte key for MAC\ncreateDeriveKey(context: string): Hasher // Key derivation\n\nclass Hasher {\n  update(data: Uint8Array): this\n  finalize(outputLength?: number): Uint8Array\n  finalizeXof(): XofReader\n}\n\nclass XofReader {\n  read(length: number): Uint8Array\n}\n```\n\n### SIMD Control\n\n```typescript\nwarmupSimd(): boolean  // Pre-initialize WASM SIMD\n```\n\n## Architecture\n\n```\nblake3-jit\n├── JS Path (<4KB)      Pure JavaScript, SMI-optimized compress\n└── WASM SIMD (>=4KB)   4-way parallel, JIT-generated at runtime\n    ├── compress4x      Single block x 4 chunks\n    ├── compressChunks4x 16 blocks x 4 chunks batched\n    └── compressParent   Merkle tree merges\n```\n\n**Key optimizations:**\n\n- SMI variables force V8 32-bit integer ALU\n- Arena pattern: all buffers in WASM linear memory (zero GC)\n- Runtime WASM codegen eliminates `.wasm` file dependency\n\n## Benchmarks\n\nCompared against native Rust (`@napi-rs/blake-hash`):\n\n| Size | blake3-jit | @napi-rs  | Notes           |\n| ---- | ---------- | --------- | --------------- |\n| 96B  | 362 MB/s   | 149 MB/s  | **2.4x faster** |\n| 512B | 748 MB/s   | 521 MB/s  | **1.4x faster** |\n| 1KB  | 811 MB/s   | 701 MB/s  | **1.2x faster** |\n| 32KB | 1.36 GB/s  | 1.97 GB/s | native wins     |\n| 1MB  | 1.38 GB/s  | 2.06 GB/s | native wins     |\n\n**Pure JS beats native Rust for small inputs** due to FFI overhead.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}