@arcjet/stable-hash
Advanced tools
| import { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js"; | ||
| //#region src/edge-light.d.ts | ||
@@ -4,0 +3,0 @@ declare const hash: ReturnType<typeof makeHasher>; |
+61
-61
| //#region src/hasher.d.ts | ||
| /** | ||
| * Writer. | ||
| */ | ||
| * Writer. | ||
| */ | ||
| interface StringWriter { | ||
| /** | ||
| * Write data. | ||
| * | ||
| * @param data | ||
| * Value. | ||
| */ | ||
| * Write data. | ||
| * | ||
| * @param data | ||
| * Value. | ||
| */ | ||
| writeString(data: string): void; | ||
@@ -20,70 +20,70 @@ } | ||
| /** | ||
| * Hash a field. | ||
| */ | ||
| * Hash a field. | ||
| */ | ||
| type FieldHasher = (data: StringWriter) => void; | ||
| /** | ||
| * Create a hasher for a boolean. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| * Create a hasher for a boolean. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| declare function bool(key: string, value: boolean): FieldHasher; | ||
| /** | ||
| * Create a hasher for an unsigned 32-bit integer. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| * Create a hasher for an unsigned 32-bit integer. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| declare function uint32(key: string, value: number): FieldHasher; | ||
| /** | ||
| * Create a hasher for a string. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| * Create a hasher for a string. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| declare function string(key: string, value: string): FieldHasher; | ||
| /** | ||
| * Create a hasher for a 64-bit floating point number. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| * Create a hasher for a 64-bit floating point number. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| declare function float64(key: string, value: number): FieldHasher; | ||
| /** | ||
| * Create a hasher for an array of strings. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param values | ||
| * Values. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| * Create a hasher for an array of strings. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param values | ||
| * Values. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| declare function stringSliceOrdered(key: string, values: ReadonlyArray<string>): FieldHasher; | ||
| /** | ||
| * Create a hasher. | ||
| * | ||
| * @param subtle | ||
| * Subtle crypto. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| * Create a hasher. | ||
| * | ||
| * @param subtle | ||
| * Subtle crypto. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| declare function makeHasher(subtle: SubtleCryptoLike): (...hashers: ReadonlyArray<FieldHasher>) => Promise<string>; | ||
| //#endregion | ||
| export { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 }; |
+0
-1
| import { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js"; | ||
| //#region src/index.d.ts | ||
@@ -4,0 +3,0 @@ declare const hash: ReturnType<typeof makeHasher>; |
| import { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js"; | ||
| //#region src/workerd.d.ts | ||
@@ -4,0 +3,0 @@ declare const hash: ReturnType<typeof makeHasher>; |
+5
-5
| { | ||
| "name": "@arcjet/stable-hash", | ||
| "version": "1.9.1", | ||
| "version": "1.10.0-rc.0", | ||
| "description": "Arcjet stable hashing utility", | ||
@@ -55,3 +55,3 @@ "keywords": [ | ||
| "build": "tsdown", | ||
| "typecheck": "tsgo --noEmit", | ||
| "typecheck": "tsc --noEmit", | ||
| "test-api": "node --test -- test/*.test.ts", | ||
@@ -63,5 +63,5 @@ "test-coverage": "node --experimental-test-coverage --test -- test/*.test.ts", | ||
| "devDependencies": { | ||
| "@types/node": "22.19.21", | ||
| "tsdown": "0.22.3", | ||
| "typescript": "6.0.3" | ||
| "@types/node": "22.20.1", | ||
| "tsdown": "0.22.7", | ||
| "typescript": "7.0.2" | ||
| }, | ||
@@ -68,0 +68,0 @@ "engines": { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
25188
0.25%1
Infinity%