{"_id":"@huggingface/blake3-jit","_rev":"2-7e58a668cecab4843350b77b1431402c","name":"@huggingface/blake3-jit","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@huggingface/blake3-jit","version":"0.0.1","keywords":["blake3","hash","fast","wasm"],"author":{"name":"Hugging Face"},"license":"MIT","_id":"@huggingface/blake3-jit@0.0.1","maintainers":[{"name":"julien-c","email":"chaumond@gmail.com"},{"name":"pierric","email":"pierrot007@gmail.com"},{"name":"coyotte508","email":"coyotte508@protonmail.com"},{"name":"xenova","email":"admin@xenova.com"},{"name":"gary149","email":"v@huggingface.co"}],"dist":{"shasum":"a176c5c4f07cf65895823db4126bacbd47c57438","tarball":"https://registry.npmjs.org/@huggingface/blake3-jit/-/blake3-jit-0.0.1.tgz","fileCount":6,"integrity":"sha512-uGGfTZIOHf5WtKkRSj/aovKZvkM4O+mAYOEESmeujaNknD9520DoImdi20Tnld1ACOF1FHdoescUvPobPZt7vw==","signatures":[{"sig":"MEUCIBvI7gLHHP0EaqUuoqnkpUop5cEh/TDuOYWCWBWZJVoZAiEAwAklX00KxoZH9SL1rKEiQ0MgbEg0cUS1nH62Jh0E0vg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":283928},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"_npmUser":{"name":"coyotte508","email":"coyotte508@protonmail.com"},"_npmVersion":"11.9.0","description":"Temporary fork of blake3-jit with Hasher.reset() and pre-allocated buffers. Will be deprecated once upstream blake3-jit exposes reset().","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/blake3-jit_0.0.1_1776263384756_0.36001253043273973","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@huggingface/blake3-jit","version":"0.0.2","description":"Temporary fork of blake3-jit with Hasher.reset() and pre-allocated buffers. Will be deprecated once upstream blake3-jit exposes reset().","keywords":["blake3","hash","fast","wasm"],"license":"MIT","author":{"name":"Hugging Face"},"publishConfig":{"access":"public"},"type":"module","sideEffects":false,"scripts":{"prepare":"tshy"},"tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","gitHead":"dba183487f4e55f1c4a90edc2a29563c40db35a0","_id":"@huggingface/blake3-jit@0.0.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-Bq7B5qabyjrJfhBsl85Jd2QBtf+HzRD7h7A9GfN2lzrrsABhOa5evVPgzoCTxR7Ub0QFj7YDK1YkYRWBU25+2w==","shasum":"1c040498e3f363e246fdc7a36c3cb2d22606f478","tarball":"https://registry.npmjs.org/@huggingface/blake3-jit/-/blake3-jit-0.0.2.tgz","fileCount":40,"unpackedSize":443569,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCEtcndm6s/052Q/tiF8EeHv0j+S7bTrXgAwasfjubRLgIhAKTJOO/NDWezRM7qQVYFGSWWZbWllh6vnwNM9az0x/fp"}]},"_npmUser":{"name":"coyotte508","email":"coyotte508@protonmail.com"},"directories":{},"maintainers":[{"name":"julien-c","email":"chaumond@gmail.com"},{"name":"pierric","email":"pierrot007@gmail.com"},{"name":"coyotte508","email":"coyotte508@protonmail.com"},{"name":"xenova","email":"admin@xenova.com"},{"name":"gary149","email":"v@huggingface.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/blake3-jit_0.0.2_1776286009134_0.9072549634370461"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-15T14:29:44.635Z","modified":"2026-04-15T20:46:49.489Z","0.0.1":"2026-04-15T14:29:44.899Z","0.0.2":"2026-04-15T20:46:49.283Z"},"author":{"name":"Hugging Face"},"license":"MIT","keywords":["blake3","hash","fast","wasm"],"description":"Temporary fork of blake3-jit with Hasher.reset() and pre-allocated buffers. Will be deprecated once upstream blake3-jit exposes reset().","maintainers":[{"name":"julien-c","email":"chaumond@gmail.com"},{"name":"pierric","email":"pierrot007@gmail.com"},{"name":"coyotte508","email":"coyotte508@protonmail.com"},{"name":"xenova","email":"admin@xenova.com"},{"name":"gary149","email":"v@huggingface.co"}],"readme":"# @huggingface/blake3-jit\n\nTemporary fork of [`blake3-jit`](https://github.com/Brooooooklyn/blake3-jit) by [@Brooooooklyn](https://github.com/Brooooooklyn) with performance enhancements for [Hugging Face Xet](https://huggingface.co/docs/hub/xet) content-defined chunking.\n\nThis package will be deprecated once upstream `blake3-jit` exposes these changes.\n\n## Changes from upstream\n\n1. **`Hasher.reset()` method** — resets the hasher to process a new message with the same key/flags, reusing all internal buffers (zero allocations per hash).\n\n2. **Pre-allocated internal buffers** — `parentBlock`, `parentCv`, `chunkCv`, `outWords`, and `finalizeCv` are allocated once in the constructor and reused across `update`/`finalize` calls, significantly reducing GC pressure in hot loops.\n\n3. **`ChunkState.resetTo()` method** — allows reusing `ChunkState` instances instead of allocating new ones per chunk.\n\n4. **Removed `Uint32Array` view fast-path** in `ChunkState.update` — the byte-by-byte `readLittleEndianWordsFull` path was empirically faster and avoids `RangeError` on unaligned offsets.\n\n5. **Dual ESM/CJS output via `tshy`** — the upstream package is ESM-only; this fork uses [`tshy`](https://github.com/isaacs/tshy) to produce both ESM and CommonJS builds, required for compatibility with Node.js CJS consumers.\n\nThese changes are also available as a patch file at [`packages/xetchunk-wasm/patches/blake3-jit.patch`](../xetchunk-wasm/patches/blake3-jit.patch) (applicable to the upstream dist bundle).\n\n## Installation\n\n```bash\nnpm install @huggingface/blake3-jit\n```\n\n## Usage\n\n```typescript\nimport { hash, Hasher } from \"@huggingface/blake3-jit\";\n\n// One-shot hashing\nconst digest = hash(new Uint8Array([1, 2, 3]));\n\n// Incremental hashing with reset (zero-alloc reuse)\nconst hasher = new Hasher();\nhasher.update(chunk1);\nconst hash1 = hasher.finalize();\n\nhasher.reset();\nhasher.update(chunk2);\nconst hash2 = hasher.finalize();\n\n// Keyed hashing (MAC)\nconst mac = Hasher.newKeyed(key).update(message).finalize();\n```\n\n## Upstream\n\nThis is a fork of [blake3-jit](https://github.com/Brooooooklyn/blake3-jit) — a high-performance BLAKE3 implementation with runtime JIT WASM SIMD, created by [LongYinan (@Brooooooklyn)](https://github.com/Brooooooklyn).\n\nSee the upstream repository for full documentation, benchmarks, and architecture details.\n\n## License\n\nMIT — see [LICENSE](./LICENSE)\n","readmeFilename":"README.md"}