@fuzdev/fuz_util 0.53.3 → 0.53.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hash_blake3.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
+
import { z } from 'zod';
|
|
10
11
|
/**
|
|
11
12
|
* Resolves when the BLAKE3 WASM module is initialized and ready.
|
|
12
13
|
* Initialization starts eagerly on import. Idempotent — safe to await multiple times.
|
|
@@ -20,4 +21,7 @@ export declare const blake3_ready: Promise<void>;
|
|
|
20
21
|
* @returns 64-character hexadecimal hash string (32 bytes).
|
|
21
22
|
*/
|
|
22
23
|
export declare const hash_blake3: (data: BufferSource | string) => string;
|
|
24
|
+
/** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
|
|
25
|
+
export declare const Blake3Hash: z.ZodString;
|
|
26
|
+
export type Blake3Hash = z.infer<typeof Blake3Hash>;
|
|
23
27
|
//# sourceMappingURL=hash_blake3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash_blake3.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/hash_blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"hash_blake3.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/hash_blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAS,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,GAAG,MAAM,KAAG,MAAsC,CAAC;AAEjG,uFAAuF;AACvF,eAAO,MAAM,UAAU,aAEuD,CAAC;AAC/E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/hash_blake3.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
+
import { z } from 'zod';
|
|
10
11
|
import { hash, init } from '@fuzdev/blake3_wasm';
|
|
11
12
|
import { to_hex } from './hex.js';
|
|
12
13
|
import { to_bytes } from './bytes.js';
|
|
@@ -23,3 +24,7 @@ export const blake3_ready = init();
|
|
|
23
24
|
* @returns 64-character hexadecimal hash string (32 bytes).
|
|
24
25
|
*/
|
|
25
26
|
export const hash_blake3 = (data) => to_hex(hash(to_bytes(data)));
|
|
27
|
+
/** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
|
|
28
|
+
export const Blake3Hash = z
|
|
29
|
+
.string()
|
|
30
|
+
.regex(/^[0-9a-f]{64}$/, 'Expected a 64-character lowercase hex blake3 hash');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_util",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.4",
|
|
4
4
|
"description": "utility belt for JS",
|
|
5
5
|
"glyph": "🦕",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@fuzdev/fuz_ui": "^0.185.2",
|
|
82
82
|
"@fuzdev/gro": "^0.197.0",
|
|
83
83
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
84
|
-
"@ryanatkn/eslint-config": "^0.10.
|
|
84
|
+
"@ryanatkn/eslint-config": "^0.10.1",
|
|
85
85
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
86
86
|
"@sveltejs/kit": "^2.50.1",
|
|
87
87
|
"@sveltejs/package": "^2.5.7",
|
package/src/lib/hash_blake3.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import {z} from 'zod';
|
|
11
12
|
import {hash, init} from '@fuzdev/blake3_wasm';
|
|
12
13
|
|
|
13
14
|
import {to_hex} from './hex.js';
|
|
@@ -27,3 +28,9 @@ export const blake3_ready = init();
|
|
|
27
28
|
* @returns 64-character hexadecimal hash string (32 bytes).
|
|
28
29
|
*/
|
|
29
30
|
export const hash_blake3 = (data: BufferSource | string): string => to_hex(hash(to_bytes(data)));
|
|
31
|
+
|
|
32
|
+
/** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
|
|
33
|
+
export const Blake3Hash = z
|
|
34
|
+
.string()
|
|
35
|
+
.regex(/^[0-9a-f]{64}$/, 'Expected a 64-character lowercase hex blake3 hash');
|
|
36
|
+
export type Blake3Hash = z.infer<typeof Blake3Hash>;
|