🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@huggingface/xetchunk-wasm

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/xetchunk-wasm - npm Package Compare versions

Comparing version
0.0.6
to
0.1.0
+1
-1
dist/commonjs/hash-utils.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"hash-utils.d.ts","sourceRoot":"","sources":["../../src/hash-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAGpD;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAMtE"}
{"version":3,"file":"hash-utils.d.ts","sourceRoot":"","sources":["../../src/hash-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAUpD;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAMtE"}

@@ -22,2 +22,9 @@ "use strict";

function fileHash(chunks) {
// Empty input short-circuits to the all-zero MerkleHash, matching Rust's
// `file_hash_with_salt` (`if chunks.is_empty() { return MerkleHash::default(); }`).
// Without this we'd return `hmac(0, zero_key)`, which the CAS shard validation rejects
// for empty files with "file reconstruction does not produce this hash".
if (chunks.length === 0) {
return new Uint8Array(32);
}
const xorb = (0, xorb_hash_js_1.xorbHash)(chunks);

@@ -24,0 +31,0 @@ return fileHasher.reset().update(xorb).finalize(32);

@@ -1,1 +0,1 @@

{"version":3,"file":"hash-utils.d.ts","sourceRoot":"","sources":["../../src/hash-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAGpD;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAMtE"}
{"version":3,"file":"hash-utils.d.ts","sourceRoot":"","sources":["../../src/hash-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAUpD;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAMtE"}

@@ -17,2 +17,9 @@ import { Hasher } from "@huggingface/blake3-jit";

export function fileHash(chunks) {
// Empty input short-circuits to the all-zero MerkleHash, matching Rust's
// `file_hash_with_salt` (`if chunks.is_empty() { return MerkleHash::default(); }`).
// Without this we'd return `hmac(0, zero_key)`, which the CAS shard validation rejects
// for empty files with "file reconstruction does not produce this hash".
if (chunks.length === 0) {
return new Uint8Array(32);
}
const xorb = xorbHash(chunks);

@@ -19,0 +26,0 @@ return fileHasher.reset().update(xorb).finalize(32);

{
"name": "@huggingface/xetchunk-wasm",
"version": "0.0.6",
"version": "0.1.0",
"description": "Content-defined chunking and hashing for Hugging Face Xet storage",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,2 +22,9 @@ import { Hasher } from "@huggingface/blake3-jit";

export function fileHash(chunks: Chunk[]): Uint8Array {
// Empty input short-circuits to the all-zero MerkleHash, matching Rust's
// `file_hash_with_salt` (`if chunks.is_empty() { return MerkleHash::default(); }`).
// Without this we'd return `hmac(0, zero_key)`, which the CAS shard validation rejects
// for empty files with "file reconstruction does not produce this hash".
if (chunks.length === 0) {
return new Uint8Array(32);
}
const xorb = xorbHash(chunks);

@@ -24,0 +31,0 @@ return fileHasher.reset().update(xorb).finalize(32);