New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@huggingface/blake3-jit

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/blake3-jit

Temporary fork of blake3-jit with Hasher.reset() and pre-allocated buffers. Will be deprecated once upstream blake3-jit exposes reset().

npmnpm
Version
0.0.1
Version published
Maintainers
5
Created
Source

@huggingface/blake3-jit

Temporary fork of blake3-jit with performance patches for @huggingface/xetchunk-wasm.

This package will be deprecated once the upstream blake3-jit package exposes the reset() method and pre-allocated internal buffers.

Changes from upstream blake3-jit@1.0.0

  • Hasher.reset() — Resets the hasher to process a new message with the same key/flags, reusing all internal buffers (zero allocations). This avoids creating a new Hasher per chunk in hot loops.

  • Pre-allocated internal buffersparentBlock, parentCv, chunkCv, outWords, and finalizeCv are allocated once in the constructor instead of per-call in addChunkCv, update, finalize, and finalizeOutput.

  • Removed Uint32Array view construction in ChunkState.update — The byte-by-byte readLittleEndianWordsFull path is faster than creating a Uint32Array view (avoids TypedArray constructor overhead) and also fixes a crash on unaligned subarrays.

Patch file

The changes are also available as a pnpm patch at packages/xetchunk-wasm/patches/blake3-jit.patch in the huggingface.js monorepo.

Usage

import { Hasher } from '@huggingface/blake3-jit';

const key = new Uint8Array(32);
const hasher = Hasher.newKeyed(key);

// Hash multiple messages without reallocating
const hash1 = hasher.update(data1).finalize(32);
const hash2 = hasher.reset().update(data2).finalize(32);
const hash3 = hasher.reset().update(data3).finalize(32);

Keywords

blake3

FAQs

Package last updated on 15 Apr 2026

Related posts