@arcjet/stable-hash
Advanced tools
+1
-1
| import { makeHasher } from './hasher.js'; | ||
| export { bool, string, stringSliceOrdered, uint32 } from './hasher.js'; | ||
| export { bool, float64, string, stringSliceOrdered, uint32 } from './hasher.js'; | ||
@@ -4,0 +4,0 @@ const hash = makeHasher(crypto.subtle); |
+11
-0
@@ -56,2 +56,13 @@ /** | ||
| /** | ||
| * Create a hasher for a 64-bit floating point number. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| export declare function float64(key: string, value: number): FieldHasher; | ||
| /** | ||
| * Create a hasher for an array of strings. | ||
@@ -58,0 +69,0 @@ * |
+18
-1
@@ -87,2 +87,19 @@ class Sha256 { | ||
| /** | ||
| * Create a hasher for a 64-bit floating point number. | ||
| * | ||
| * @param key | ||
| * Key. | ||
| * @param value | ||
| * Value. | ||
| * @returns | ||
| * Hasher. | ||
| */ | ||
| function float64(key, value) { | ||
| return (data) => { | ||
| data.writeString(key); | ||
| data.writeString(fieldSeparator); | ||
| data.writeString(value.toString()); | ||
| }; | ||
| } | ||
| /** | ||
| * Create a hasher for an array of strings. | ||
@@ -186,2 +203,2 @@ * | ||
| export { bool, makeHasher, string, stringSliceOrdered, uint32 }; | ||
| export { bool, float64, makeHasher, string, stringSliceOrdered, uint32 }; |
+1
-1
| import * as crypto from 'node:crypto'; | ||
| import { makeHasher } from './hasher.js'; | ||
| export { bool, string, stringSliceOrdered, uint32 } from './hasher.js'; | ||
| export { bool, float64, string, stringSliceOrdered, uint32 } from './hasher.js'; | ||
@@ -5,0 +5,0 @@ const hash = makeHasher(crypto.subtle); |
+5
-5
| { | ||
| "name": "@arcjet/stable-hash", | ||
| "version": "1.1.0", | ||
| "version": "1.2.0", | ||
| "description": "Arcjet stable hashing utility", | ||
@@ -57,6 +57,6 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@arcjet/eslint-config": "1.1.0", | ||
| "@arcjet/rollup-config": "1.1.0", | ||
| "@rollup/wasm-node": "4.57.0", | ||
| "@types/node": "25.1.0", | ||
| "@arcjet/eslint-config": "1.2.0", | ||
| "@arcjet/rollup-config": "1.2.0", | ||
| "@rollup/wasm-node": "4.57.1", | ||
| "@types/node": "24.11.0", | ||
| "eslint": "9.39.2", | ||
@@ -63,0 +63,0 @@ "typescript": "5.9.3" |
+1
-1
| import { makeHasher } from './hasher.js'; | ||
| export { bool, string, stringSliceOrdered, uint32 } from './hasher.js'; | ||
| export { bool, float64, string, stringSliceOrdered, uint32 } from './hasher.js'; | ||
@@ -4,0 +4,0 @@ const hash = makeHasher(crypto.subtle); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
23533
2.51%306
10.07%1
Infinity%