@arcjet/stable-hash 1.6.1 → 1.7.0-rc.1

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.
@@ -0,0 +1,6 @@
1
+ import { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js";
2
+
3
+ //#region src/edge-light.d.ts
4
+ declare const hash: ReturnType<typeof makeHasher>;
5
+ //#endregion
6
+ export { FieldHasher, StringWriter, bool, float64, hash, makeHasher, string, stringSliceOrdered, uint32 };
@@ -0,0 +1,5 @@
1
+ import { bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js";
2
+ //#region src/edge-light.ts
3
+ const hash = makeHasher(crypto.subtle);
4
+ //#endregion
5
+ export { bool, float64, hash, makeHasher, string, stringSliceOrdered, uint32 };
@@ -0,0 +1,88 @@
1
+ //#region src/hasher.d.ts
2
+ /**
3
+ * Writer.
4
+ */
5
+ interface StringWriter {
6
+ /**
7
+ * Write data.
8
+ *
9
+ * @param data
10
+ * Value.
11
+ */
12
+ writeString(data: string): void;
13
+ }
14
+ interface SubtleCryptoLike {
15
+ digest(algorithm: {
16
+ name: string;
17
+ } | string, data: ArrayBufferView<ArrayBufferLike> | ArrayBufferLike): Promise<ArrayBuffer>;
18
+ }
19
+ /**
20
+ * Hash a field.
21
+ */
22
+ type FieldHasher = (data: StringWriter) => void;
23
+ /**
24
+ * Create a hasher for a boolean.
25
+ *
26
+ * @param key
27
+ * Key.
28
+ * @param value
29
+ * Value.
30
+ * @returns
31
+ * Hasher.
32
+ */
33
+ declare function bool(key: string, value: boolean): FieldHasher;
34
+ /**
35
+ * Create a hasher for an unsigned 32-bit integer.
36
+ *
37
+ * @param key
38
+ * Key.
39
+ * @param value
40
+ * Value.
41
+ * @returns
42
+ * Hasher.
43
+ */
44
+ declare function uint32(key: string, value: number): FieldHasher;
45
+ /**
46
+ * Create a hasher for a string.
47
+ *
48
+ * @param key
49
+ * Key.
50
+ * @param value
51
+ * Value.
52
+ * @returns
53
+ * Hasher.
54
+ */
55
+ declare function string(key: string, value: string): FieldHasher;
56
+ /**
57
+ * Create a hasher for a 64-bit floating point number.
58
+ *
59
+ * @param key
60
+ * Key.
61
+ * @param value
62
+ * Value.
63
+ * @returns
64
+ * Hasher.
65
+ */
66
+ declare function float64(key: string, value: number): FieldHasher;
67
+ /**
68
+ * Create a hasher for an array of strings.
69
+ *
70
+ * @param key
71
+ * Key.
72
+ * @param values
73
+ * Values.
74
+ * @returns
75
+ * Hasher.
76
+ */
77
+ declare function stringSliceOrdered(key: string, values: ReadonlyArray<string>): FieldHasher;
78
+ /**
79
+ * Create a hasher.
80
+ *
81
+ * @param subtle
82
+ * Subtle crypto.
83
+ * @returns
84
+ * Hasher.
85
+ */
86
+ declare function makeHasher(subtle: SubtleCryptoLike): (...hashers: ReadonlyArray<FieldHasher>) => Promise<string>;
87
+ //#endregion
88
+ export { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 };
package/dist/hasher.js ADDED
@@ -0,0 +1,163 @@
1
+ //#region src/hasher.ts
2
+ var Sha256 = class {
3
+ encoder;
4
+ subtle;
5
+ buf;
6
+ constructor(subtle) {
7
+ this.subtle = subtle;
8
+ this.encoder = new TextEncoder();
9
+ this.buf = "";
10
+ }
11
+ writeString(data) {
12
+ this.buf += data;
13
+ }
14
+ async digest() {
15
+ const buf = this.encoder.encode(this.buf);
16
+ const digest = await this.subtle.digest("SHA-256", buf);
17
+ return new Uint8Array(digest);
18
+ }
19
+ };
20
+ const maxUint32 = 4294967295;
21
+ const fieldSeparator = ":";
22
+ const itemSeparator = ",";
23
+ /**
24
+ * Create a hasher for a boolean.
25
+ *
26
+ * @param key
27
+ * Key.
28
+ * @param value
29
+ * Value.
30
+ * @returns
31
+ * Hasher.
32
+ */
33
+ function bool(key, value) {
34
+ return (data) => {
35
+ data.writeString(key);
36
+ data.writeString(fieldSeparator);
37
+ if (value) data.writeString("true");
38
+ else data.writeString("false");
39
+ };
40
+ }
41
+ /**
42
+ * Create a hasher for an unsigned 32-bit integer.
43
+ *
44
+ * @param key
45
+ * Key.
46
+ * @param value
47
+ * Value.
48
+ * @returns
49
+ * Hasher.
50
+ */
51
+ function uint32(key, value) {
52
+ return (data) => {
53
+ data.writeString(key);
54
+ data.writeString(fieldSeparator);
55
+ if (value > maxUint32) data.writeString("0");
56
+ else data.writeString(value.toFixed(0));
57
+ };
58
+ }
59
+ /**
60
+ * Create a hasher for a string.
61
+ *
62
+ * @param key
63
+ * Key.
64
+ * @param value
65
+ * Value.
66
+ * @returns
67
+ * Hasher.
68
+ */
69
+ function string(key, value) {
70
+ return (data) => {
71
+ data.writeString(key);
72
+ data.writeString(fieldSeparator);
73
+ data.writeString(`"`);
74
+ data.writeString(value.replaceAll(`"`, `\\"`));
75
+ data.writeString(`"`);
76
+ };
77
+ }
78
+ /**
79
+ * Create a hasher for a 64-bit floating point number.
80
+ *
81
+ * @param key
82
+ * Key.
83
+ * @param value
84
+ * Value.
85
+ * @returns
86
+ * Hasher.
87
+ */
88
+ function float64(key, value) {
89
+ return (data) => {
90
+ data.writeString(key);
91
+ data.writeString(fieldSeparator);
92
+ data.writeString(value.toString());
93
+ };
94
+ }
95
+ /**
96
+ * Create a hasher for an array of strings.
97
+ *
98
+ * @param key
99
+ * Key.
100
+ * @param values
101
+ * Values.
102
+ * @returns
103
+ * Hasher.
104
+ */
105
+ function stringSliceOrdered(key, values) {
106
+ return (data) => {
107
+ data.writeString(key);
108
+ data.writeString(fieldSeparator);
109
+ data.writeString("[");
110
+ for (const value of Array.from(values).sort()) {
111
+ data.writeString(`"`);
112
+ data.writeString(value.replaceAll(`"`, `\\"`));
113
+ data.writeString(`"`);
114
+ data.writeString(itemSeparator);
115
+ }
116
+ data.writeString("]");
117
+ };
118
+ }
119
+ /**
120
+ * Create a hasher.
121
+ *
122
+ * @param subtle
123
+ * Subtle crypto.
124
+ * @returns
125
+ * Hasher.
126
+ */
127
+ function makeHasher(subtle) {
128
+ /**
129
+ * Hash fields.
130
+ *
131
+ * @param hashers
132
+ * Hashers.
133
+ * @returns
134
+ * Promise to a hash.
135
+ */
136
+ return async function hash(...hashers) {
137
+ const h = new Sha256(subtle);
138
+ for (const hasher of hashers) {
139
+ hasher(h);
140
+ h.writeString(itemSeparator);
141
+ }
142
+ return hex(await h.digest());
143
+ };
144
+ }
145
+ const hexSliceLookupTable = (function() {
146
+ const alphabet = "0123456789abcdef";
147
+ const table = new Array(256);
148
+ for (let i = 0; i < 16; ++i) {
149
+ const i16 = i * 16;
150
+ for (let j = 0; j < 16; ++j) table[i16 + j] = alphabet[i] + alphabet[j];
151
+ }
152
+ return table;
153
+ })();
154
+ function hex(buf) {
155
+ const len = buf.length;
156
+ const start = 0;
157
+ const end = len;
158
+ let out = "";
159
+ for (let i = start; i < end; ++i) out += hexSliceLookupTable[buf[i]];
160
+ return out;
161
+ }
162
+ //#endregion
163
+ export { bool, float64, makeHasher, string, stringSliceOrdered, uint32 };
@@ -0,0 +1,6 @@
1
+ import { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js";
2
+
3
+ //#region src/index.d.ts
4
+ declare const hash: ReturnType<typeof makeHasher>;
5
+ //#endregion
6
+ export { FieldHasher, StringWriter, bool, float64, hash, makeHasher, string, stringSliceOrdered, uint32 };
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js";
2
+ import * as crypto from "node:crypto";
3
+ //#region src/index.ts
4
+ const hash = makeHasher(crypto.subtle);
5
+ //#endregion
6
+ export { bool, float64, hash, makeHasher, string, stringSliceOrdered, uint32 };
@@ -0,0 +1,6 @@
1
+ import { FieldHasher, StringWriter, bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js";
2
+
3
+ //#region src/workerd.d.ts
4
+ declare const hash: ReturnType<typeof makeHasher>;
5
+ //#endregion
6
+ export { FieldHasher, StringWriter, bool, float64, hash, makeHasher, string, stringSliceOrdered, uint32 };
@@ -0,0 +1,5 @@
1
+ import { bool, float64, makeHasher, string, stringSliceOrdered, uint32 } from "./hasher.js";
2
+ //#region src/workerd.ts
3
+ const hash = makeHasher(crypto.subtle);
4
+ //#endregion
5
+ export { bool, float64, hash, makeHasher, string, stringSliceOrdered, uint32 };
package/package.json CHANGED
@@ -1,68 +1,70 @@
1
1
  {
2
2
  "name": "@arcjet/stable-hash",
3
- "version": "1.6.1",
3
+ "version": "1.7.0-rc.1",
4
4
  "description": "Arcjet stable hashing utility",
5
5
  "keywords": [
6
6
  "arcjet",
7
7
  "hash",
8
- "utility",
9
- "util"
8
+ "util",
9
+ "utility"
10
10
  ],
11
- "license": "Apache-2.0",
12
11
  "homepage": "https://arcjet.com",
13
- "repository": {
14
- "type": "git",
15
- "url": "git+https://github.com/arcjet/arcjet-js.git",
16
- "directory": "stable-hash"
17
- },
18
12
  "bugs": {
19
13
  "url": "https://github.com/arcjet/arcjet-js/issues",
20
14
  "email": "support@arcjet.com"
21
15
  },
16
+ "license": "Apache-2.0",
22
17
  "author": {
23
18
  "name": "Arcjet",
24
19
  "email": "support@arcjet.com",
25
20
  "url": "https://arcjet.com"
26
21
  },
27
- "engines": {
28
- "node": ">=22.21.0 <23 || >=24.5.0"
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/arcjet/arcjet-js.git",
25
+ "directory": "stable-hash"
29
26
  },
27
+ "files": [
28
+ "dist"
29
+ ],
30
30
  "type": "module",
31
- "main": "./index.js",
32
- "types": "./index.d.ts",
31
+ "main": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
33
  "exports": {
34
- "edge-light": "./edge-light.js",
35
- "workerd": "./workerd.js",
36
- "default": "./index.js"
34
+ ".": {
35
+ "edge-light": {
36
+ "types": "./dist/edge-light.d.ts",
37
+ "default": "./dist/edge-light.js"
38
+ },
39
+ "workerd": {
40
+ "types": "./dist/workerd.d.ts",
41
+ "default": "./dist/workerd.js"
42
+ },
43
+ "default": {
44
+ "types": "./dist/index.d.ts",
45
+ "default": "./dist/index.js"
46
+ }
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public",
52
+ "tag": "latest"
37
53
  },
38
- "files": [
39
- "edge-light.d.ts",
40
- "edge-light.js",
41
- "hasher.d.ts",
42
- "hasher.js",
43
- "index.d.ts",
44
- "index.js",
45
- "workerd.d.ts",
46
- "workerd.js"
47
- ],
48
54
  "scripts": {
49
- "build": "rollup --config rollup.config.js",
50
- "lint": "eslint .",
51
- "test-api": "node --test -- test/*.test.js",
52
- "test-coverage": "node --experimental-test-coverage --test -- test/*.test.js",
53
- "test": "npm run build && npm run lint && npm run test-coverage"
55
+ "build": "tsdown",
56
+ "typecheck": "tsgo --noEmit",
57
+ "test-api": "node --test -- test/*.test.ts",
58
+ "test-coverage": "node --experimental-test-coverage --test -- test/*.test.ts",
59
+ "test": "npm run build && npm run test-coverage"
54
60
  },
55
61
  "dependencies": {},
56
62
  "devDependencies": {
57
- "@arcjet/eslint-config": "1.6.1",
58
- "@arcjet/rollup-config": "1.6.1",
59
- "@rollup/wasm-node": "4.62.2",
60
63
  "@types/node": "22.19.21",
61
- "eslint": "9.39.4",
62
- "typescript": "5.9.3"
64
+ "tsdown": "0.22.3",
65
+ "typescript": "6.0.3"
63
66
  },
64
- "publishConfig": {
65
- "access": "public",
66
- "tag": "latest"
67
+ "engines": {
68
+ "node": ">=22.21.0 <23 || >=24.5.0"
67
69
  }
68
70
  }
package/edge-light.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./hasher.js";
2
- export declare const hash: (...hashers: ReadonlyArray<import("./hasher.js").FieldHasher>) => Promise<string>;
package/edge-light.js DELETED
@@ -1,6 +0,0 @@
1
- import { makeHasher } from './hasher.js';
2
- export { bool, float64, string, stringSliceOrdered, uint32 } from './hasher.js';
3
-
4
- const hash = makeHasher(crypto.subtle);
5
-
6
- export { hash, makeHasher };
package/hasher.d.ts DELETED
@@ -1,86 +0,0 @@
1
- /**
2
- * Writer.
3
- */
4
- export interface StringWriter {
5
- /**
6
- * Write data.
7
- *
8
- * @param data
9
- * Value.
10
- */
11
- writeString(data: string): void;
12
- }
13
- interface SubtleCryptoLike {
14
- digest(algorithm: {
15
- name: string;
16
- } | string, data: ArrayBufferView<ArrayBufferLike> | ArrayBufferLike): Promise<ArrayBuffer>;
17
- }
18
- /**
19
- * Hash a field.
20
- */
21
- export type FieldHasher = (data: StringWriter) => void;
22
- /**
23
- * Create a hasher for a boolean.
24
- *
25
- * @param key
26
- * Key.
27
- * @param value
28
- * Value.
29
- * @returns
30
- * Hasher.
31
- */
32
- export declare function bool(key: string, value: boolean): FieldHasher;
33
- /**
34
- * Create a hasher for an unsigned 32-bit integer.
35
- *
36
- * @param key
37
- * Key.
38
- * @param value
39
- * Value.
40
- * @returns
41
- * Hasher.
42
- */
43
- export declare function uint32(key: string, value: number): FieldHasher;
44
- /**
45
- * Create a hasher for a string.
46
- *
47
- * @param key
48
- * Key.
49
- * @param value
50
- * Value.
51
- * @returns
52
- * Hasher.
53
- */
54
- export declare function string(key: string, value: string): FieldHasher;
55
- /**
56
- * Create a hasher for a 64-bit floating point number.
57
- *
58
- * @param key
59
- * Key.
60
- * @param value
61
- * Value.
62
- * @returns
63
- * Hasher.
64
- */
65
- export declare function float64(key: string, value: number): FieldHasher;
66
- /**
67
- * Create a hasher for an array of strings.
68
- *
69
- * @param key
70
- * Key.
71
- * @param values
72
- * Values.
73
- * @returns
74
- * Hasher.
75
- */
76
- export declare function stringSliceOrdered(key: string, values: ReadonlyArray<string>): FieldHasher;
77
- /**
78
- * Create a hasher.
79
- *
80
- * @param subtle
81
- * Subtle crypto.
82
- * @returns
83
- * Hasher.
84
- */
85
- export declare function makeHasher(subtle: SubtleCryptoLike): (...hashers: ReadonlyArray<FieldHasher>) => Promise<string>;
86
- export {};
package/hasher.js DELETED
@@ -1,202 +0,0 @@
1
- class Sha256 {
2
- encoder;
3
- subtle;
4
- buf;
5
- constructor(subtle) {
6
- this.subtle = subtle;
7
- this.encoder = new TextEncoder();
8
- this.buf = "";
9
- }
10
- writeString(data) {
11
- this.buf += data;
12
- }
13
- async digest() {
14
- const buf = this.encoder.encode(this.buf);
15
- const digest = await this.subtle.digest("SHA-256", buf);
16
- return new Uint8Array(digest);
17
- }
18
- }
19
- // After this, it needs to wrap to 0
20
- const maxUint32 = 4294967295;
21
- const fieldSeparator = ":";
22
- const itemSeparator = ",";
23
- /**
24
- * Create a hasher for a boolean.
25
- *
26
- * @param key
27
- * Key.
28
- * @param value
29
- * Value.
30
- * @returns
31
- * Hasher.
32
- */
33
- function bool(key, value) {
34
- return (data) => {
35
- data.writeString(key);
36
- data.writeString(fieldSeparator);
37
- if (value) {
38
- data.writeString("true");
39
- }
40
- else {
41
- data.writeString("false");
42
- }
43
- };
44
- }
45
- /**
46
- * Create a hasher for an unsigned 32-bit integer.
47
- *
48
- * @param key
49
- * Key.
50
- * @param value
51
- * Value.
52
- * @returns
53
- * Hasher.
54
- */
55
- function uint32(key, value) {
56
- return (data) => {
57
- data.writeString(key);
58
- data.writeString(fieldSeparator);
59
- if (value > maxUint32) {
60
- data.writeString("0");
61
- }
62
- else {
63
- data.writeString(value.toFixed(0));
64
- }
65
- };
66
- }
67
- /**
68
- * Create a hasher for a string.
69
- *
70
- * @param key
71
- * Key.
72
- * @param value
73
- * Value.
74
- * @returns
75
- * Hasher.
76
- */
77
- function string(key, value) {
78
- return (data) => {
79
- data.writeString(key);
80
- data.writeString(fieldSeparator);
81
- data.writeString(`"`);
82
- data.writeString(value.replaceAll(`"`, `\\"`));
83
- data.writeString(`"`);
84
- };
85
- }
86
- /**
87
- * Create a hasher for a 64-bit floating point number.
88
- *
89
- * @param key
90
- * Key.
91
- * @param value
92
- * Value.
93
- * @returns
94
- * Hasher.
95
- */
96
- function float64(key, value) {
97
- return (data) => {
98
- data.writeString(key);
99
- data.writeString(fieldSeparator);
100
- data.writeString(value.toString());
101
- };
102
- }
103
- /**
104
- * Create a hasher for an array of strings.
105
- *
106
- * @param key
107
- * Key.
108
- * @param values
109
- * Values.
110
- * @returns
111
- * Hasher.
112
- */
113
- function stringSliceOrdered(key, values) {
114
- return (data) => {
115
- data.writeString(key);
116
- data.writeString(fieldSeparator);
117
- data.writeString("[");
118
- for (const value of Array.from(values).sort()) {
119
- data.writeString(`"`);
120
- data.writeString(value.replaceAll(`"`, `\\"`));
121
- data.writeString(`"`);
122
- data.writeString(itemSeparator);
123
- }
124
- data.writeString("]");
125
- };
126
- }
127
- /**
128
- * Create a hasher.
129
- *
130
- * @param subtle
131
- * Subtle crypto.
132
- * @returns
133
- * Hasher.
134
- */
135
- function makeHasher(subtle) {
136
- /**
137
- * Hash fields.
138
- *
139
- * @param hashers
140
- * Hashers.
141
- * @returns
142
- * Promise to a hash.
143
- */
144
- return async function hash(...hashers) {
145
- const h = new Sha256(subtle);
146
- for (const hasher of hashers) {
147
- hasher(h);
148
- h.writeString(itemSeparator);
149
- }
150
- const digest = await h.digest();
151
- return hex(digest);
152
- };
153
- }
154
- // Hex encoding logic from https://github.com/feross/buffer but adjusted for
155
- // our use.
156
- //
157
- // Licensed: The MIT License (MIT)
158
- //
159
- // Copyright (c) Feross Aboukhadijeh, and other contributors.
160
- //
161
- // Permission is hereby granted, free of charge, to any person obtaining a copy
162
- // of this software and associated documentation files (the "Software"), to deal
163
- // in the Software without restriction, including without limitation the rights
164
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
165
- // copies of the Software, and to permit persons to whom the Software is
166
- // furnished to do so, subject to the following conditions:
167
- //
168
- // The above copyright notice and this permission notice shall be included in
169
- // all copies or substantial portions of the Software.
170
- //
171
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
172
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
173
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
174
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
175
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
176
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
177
- // THE SOFTWARE.
178
- // https://github.com/feross/buffer/blob/5857e295f4d37e3ad02c3abcbf7e8e5ef51f3be6/index.js#L2096-L2106
179
- const hexSliceLookupTable = (function () {
180
- const alphabet = "0123456789abcdef";
181
- const table = new Array(256);
182
- for (let i = 0; i < 16; ++i) {
183
- const i16 = i * 16;
184
- for (let j = 0; j < 16; ++j) {
185
- table[i16 + j] = alphabet[i] + alphabet[j];
186
- }
187
- }
188
- return table;
189
- })();
190
- // https://github.com/feross/buffer/blob/5857e295f4d37e3ad02c3abcbf7e8e5ef51f3be6/index.js#L1085-L1096
191
- function hex(buf) {
192
- const len = buf.length;
193
- const start = 0;
194
- const end = len;
195
- let out = "";
196
- for (let i = start; i < end; ++i) {
197
- out += hexSliceLookupTable[buf[i]];
198
- }
199
- return out;
200
- }
201
-
202
- export { bool, float64, makeHasher, string, stringSliceOrdered, uint32 };
package/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./hasher.js";
2
- export declare const hash: (...hashers: ReadonlyArray<import("./hasher.js").FieldHasher>) => Promise<string>;
package/index.js DELETED
@@ -1,7 +0,0 @@
1
- import * as crypto from 'node:crypto';
2
- import { makeHasher } from './hasher.js';
3
- export { bool, float64, string, stringSliceOrdered, uint32 } from './hasher.js';
4
-
5
- const hash = makeHasher(crypto.subtle);
6
-
7
- export { hash, makeHasher };
package/workerd.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./hasher.js";
2
- export declare const hash: (...hashers: ReadonlyArray<import("./hasher.js").FieldHasher>) => Promise<string>;
package/workerd.js DELETED
@@ -1,6 +0,0 @@
1
- import { makeHasher } from './hasher.js';
2
- export { bool, float64, string, stringSliceOrdered, uint32 } from './hasher.js';
3
-
4
- const hash = makeHasher(crypto.subtle);
5
-
6
- export { hash, makeHasher };