distillate 0.8.2 → 0.10.0

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.
Files changed (42) hide show
  1. package/README.md +53 -6
  2. package/dist/blocked/index.cjs +15 -10
  3. package/dist/blocked/index.d.cts +7 -6
  4. package/dist/blocked/index.d.ts +7 -6
  5. package/dist/blocked/index.js +13 -9
  6. package/dist/bloom/index.cjs +35 -34
  7. package/dist/bloom/index.d.cts +22 -17
  8. package/dist/bloom/index.d.ts +22 -17
  9. package/dist/bloom/index.js +32 -32
  10. package/dist/bytes-DCuYtUVS.d.cts +4 -0
  11. package/dist/bytes-DCuYtUVS.d.ts +4 -0
  12. package/dist/frame/index.cjs +9 -0
  13. package/dist/frame/index.d.cts +2 -0
  14. package/dist/frame/index.d.ts +2 -0
  15. package/dist/frame/index.js +2 -0
  16. package/dist/fuse/index.cjs +27 -23
  17. package/dist/fuse/index.d.cts +7 -6
  18. package/dist/fuse/index.d.ts +7 -6
  19. package/dist/fuse/index.js +15 -12
  20. package/dist/hasher-D8LCBTOM.cjs +276 -0
  21. package/dist/hasher-DVWXS_vJ.js +229 -0
  22. package/dist/hll/index.cjs +366 -0
  23. package/dist/hll/index.d.cts +120 -0
  24. package/dist/hll/index.d.ts +120 -0
  25. package/dist/hll/index.js +356 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.cts +2 -3
  28. package/dist/index.d.ts +2 -3
  29. package/dist/index.js +1 -1
  30. package/dist/serialize--xR6vGSW.d.cts +112 -0
  31. package/dist/serialize--xR6vGSW.d.ts +112 -0
  32. package/dist/serialize-CHikZ4GH.cjs +296 -0
  33. package/dist/serialize-CMSYFym-.js +201 -0
  34. package/dist/sizing-BLzZk2zr.cjs +28 -0
  35. package/dist/sizing-BtUrtvF_.js +17 -0
  36. package/dist/sizing-wYOW27eY.d.cts +22 -0
  37. package/dist/sizing-wYOW27eY.d.ts +22 -0
  38. package/package.json +26 -10
  39. package/dist/serialize-BqIcsR2J.js +0 -388
  40. package/dist/serialize-CXnRWItH.cjs +0 -513
  41. package/dist/serialize-ChyWpB9F.d.cts +0 -73
  42. package/dist/serialize-ChyWpB9F.d.ts +0 -73
@@ -0,0 +1,276 @@
1
+ //#region src/core/bytes.ts
2
+ const encoder = new TextEncoder();
3
+ function normalize(input) {
4
+ if (typeof input === "string") return encoder.encode(input);
5
+ if (input instanceof Uint8Array) return input;
6
+ return new Uint8Array(input);
7
+ }
8
+ //#endregion
9
+ //#region src/core/hasher.ts
10
+ let RLO = 0;
11
+ let RHI = 0;
12
+ const LANES = {
13
+ w0: 0,
14
+ w1: 0,
15
+ w2: 0,
16
+ w3: 0
17
+ };
18
+ function mul64(alo, ahi, blo, bhi) {
19
+ const a0 = alo & 65535;
20
+ const a1 = alo >>> 16;
21
+ const a2 = ahi & 65535;
22
+ const a3 = ahi >>> 16;
23
+ const b0 = blo & 65535;
24
+ const b1 = blo >>> 16;
25
+ const b2 = bhi & 65535;
26
+ const b3 = bhi >>> 16;
27
+ let c0 = a0 * b0;
28
+ let c1 = c0 >>> 16;
29
+ c0 &= 65535;
30
+ c1 += a1 * b0;
31
+ let c2 = c1 >>> 16;
32
+ c1 &= 65535;
33
+ c1 += a0 * b1;
34
+ c2 += c1 >>> 16;
35
+ c1 &= 65535;
36
+ c2 += a2 * b0;
37
+ let c3 = c2 >>> 16;
38
+ c2 &= 65535;
39
+ c2 += a1 * b1;
40
+ c3 += c2 >>> 16;
41
+ c2 &= 65535;
42
+ c2 += a0 * b2;
43
+ c3 += c2 >>> 16;
44
+ c2 &= 65535;
45
+ c3 += a3 * b0 + a2 * b1 + a1 * b2 + a0 * b3;
46
+ c3 &= 65535;
47
+ RLO = (c1 << 16 | c0) >>> 0;
48
+ RHI = (c3 << 16 | c2) >>> 0;
49
+ }
50
+ function fmix64(lo, hi) {
51
+ let l = lo;
52
+ let h = hi;
53
+ l = (l ^ h >>> 1) >>> 0;
54
+ mul64(l, h, 3981806797, 4283543511);
55
+ l = RLO;
56
+ h = RHI;
57
+ l = (l ^ h >>> 1) >>> 0;
58
+ mul64(l, h, 444984403, 3301882366);
59
+ l = RLO;
60
+ h = RHI;
61
+ l = (l ^ h >>> 1) >>> 0;
62
+ RLO = l;
63
+ RHI = h;
64
+ }
65
+ function rotl32(x, r) {
66
+ return (x << r | x >>> 32 - r) >>> 0;
67
+ }
68
+ function fmix32(h) {
69
+ let x = h;
70
+ x ^= x >>> 16;
71
+ x = Math.imul(x, 2246822507);
72
+ x ^= x >>> 13;
73
+ x = Math.imul(x, 3266489909);
74
+ x ^= x >>> 16;
75
+ return x >>> 0;
76
+ }
77
+ const K1 = 597399067;
78
+ const K2 = 2869860233;
79
+ const K3 = 951274213;
80
+ const K4 = 2716044179;
81
+ function computeLanes(bytes, seed, len) {
82
+ const nblocks = len >>> 4;
83
+ let h1 = seed >>> 0;
84
+ let h2 = seed >>> 0;
85
+ let h3 = seed >>> 0;
86
+ let h4 = seed >>> 0;
87
+ for (let i = 0; i < nblocks; i++) {
88
+ const b = i * 16;
89
+ let k1 = ((bytes[b] ?? 0) | (bytes[b + 1] ?? 0) << 8 | (bytes[b + 2] ?? 0) << 16 | (bytes[b + 3] ?? 0) << 24) >>> 0;
90
+ let k2 = ((bytes[b + 4] ?? 0) | (bytes[b + 5] ?? 0) << 8 | (bytes[b + 6] ?? 0) << 16 | (bytes[b + 7] ?? 0) << 24) >>> 0;
91
+ let k3 = ((bytes[b + 8] ?? 0) | (bytes[b + 9] ?? 0) << 8 | (bytes[b + 10] ?? 0) << 16 | (bytes[b + 11] ?? 0) << 24) >>> 0;
92
+ let k4 = ((bytes[b + 12] ?? 0) | (bytes[b + 13] ?? 0) << 8 | (bytes[b + 14] ?? 0) << 16 | (bytes[b + 15] ?? 0) << 24) >>> 0;
93
+ k1 = Math.imul(rotl32(Math.imul(k1, K1), 15), K2);
94
+ h1 ^= k1;
95
+ h1 = rotl32(h1, 19);
96
+ h1 = h1 + h2 >>> 0;
97
+ h1 = Math.imul(h1, 5) + 1444728091 >>> 0;
98
+ k2 = Math.imul(rotl32(Math.imul(k2, K2), 16), K3);
99
+ h2 ^= k2;
100
+ h2 = rotl32(h2, 17);
101
+ h2 = h2 + h3 >>> 0;
102
+ h2 = Math.imul(h2, 5) + 197830471 >>> 0;
103
+ k3 = Math.imul(rotl32(Math.imul(k3, K3), 17), K4);
104
+ h3 ^= k3;
105
+ h3 = rotl32(h3, 15);
106
+ h3 = h3 + h4 >>> 0;
107
+ h3 = Math.imul(h3, 5) + 2530024501 >>> 0;
108
+ k4 = Math.imul(rotl32(Math.imul(k4, K4), 18), K1);
109
+ h4 ^= k4;
110
+ h4 = rotl32(h4, 13);
111
+ h4 = h4 + h1 >>> 0;
112
+ h4 = Math.imul(h4, 5) + 850148119 >>> 0;
113
+ }
114
+ let k1 = 0;
115
+ let k2 = 0;
116
+ let k3 = 0;
117
+ let k4 = 0;
118
+ const tail = nblocks * 16;
119
+ const rem = len & 15;
120
+ if (rem >= 15) k4 ^= (bytes[tail + 14] ?? 0) << 16;
121
+ if (rem >= 14) k4 ^= (bytes[tail + 13] ?? 0) << 8;
122
+ if (rem >= 13) {
123
+ k4 ^= bytes[tail + 12] ?? 0;
124
+ k4 = Math.imul(rotl32(Math.imul(k4, K4), 18), K1);
125
+ h4 ^= k4;
126
+ }
127
+ if (rem >= 12) k3 ^= (bytes[tail + 11] ?? 0) << 24;
128
+ if (rem >= 11) k3 ^= (bytes[tail + 10] ?? 0) << 16;
129
+ if (rem >= 10) k3 ^= (bytes[tail + 9] ?? 0) << 8;
130
+ if (rem >= 9) {
131
+ k3 ^= bytes[tail + 8] ?? 0;
132
+ k3 = Math.imul(rotl32(Math.imul(k3, K3), 17), K4);
133
+ h3 ^= k3;
134
+ }
135
+ if (rem >= 8) k2 ^= (bytes[tail + 7] ?? 0) << 24;
136
+ if (rem >= 7) k2 ^= (bytes[tail + 6] ?? 0) << 16;
137
+ if (rem >= 6) k2 ^= (bytes[tail + 5] ?? 0) << 8;
138
+ if (rem >= 5) {
139
+ k2 ^= bytes[tail + 4] ?? 0;
140
+ k2 = Math.imul(rotl32(Math.imul(k2, K2), 16), K3);
141
+ h2 ^= k2;
142
+ }
143
+ if (rem >= 4) k1 ^= (bytes[tail + 3] ?? 0) << 24;
144
+ if (rem >= 3) k1 ^= (bytes[tail + 2] ?? 0) << 16;
145
+ if (rem >= 2) k1 ^= (bytes[tail + 1] ?? 0) << 8;
146
+ if (rem >= 1) {
147
+ k1 ^= bytes[tail] ?? 0;
148
+ k1 = Math.imul(rotl32(Math.imul(k1, K1), 15), K2);
149
+ h1 ^= k1;
150
+ }
151
+ h1 = (h1 ^ len) >>> 0;
152
+ h2 = (h2 ^ len) >>> 0;
153
+ h3 = (h3 ^ len) >>> 0;
154
+ h4 = (h4 ^ len) >>> 0;
155
+ h1 = h1 + h2 >>> 0;
156
+ h1 = h1 + h3 >>> 0;
157
+ h1 = h1 + h4 >>> 0;
158
+ h2 = h2 + h1 >>> 0;
159
+ h3 = h3 + h1 >>> 0;
160
+ h4 = h4 + h1 >>> 0;
161
+ h1 = fmix32(h1);
162
+ h2 = fmix32(h2);
163
+ h3 = fmix32(h3);
164
+ h4 = fmix32(h4);
165
+ h1 = h1 + h2 >>> 0;
166
+ h1 = h1 + h3 >>> 0;
167
+ h1 = h1 + h4 >>> 0;
168
+ h2 = h2 + h1 >>> 0;
169
+ h3 = h3 + h1 >>> 0;
170
+ h4 = h4 + h1 >>> 0;
171
+ LANES.w0 = h1;
172
+ LANES.w1 = h2;
173
+ LANES.w2 = h3;
174
+ LANES.w3 = h4;
175
+ }
176
+ const keyEncoder = new TextEncoder();
177
+ let keyBuf = new Uint8Array(256);
178
+ let encBytes = keyBuf;
179
+ let encLen = 0;
180
+ function encodeKey(key) {
181
+ if (typeof key === "string") {
182
+ const cap = key.length * 3;
183
+ if (keyBuf.length < cap) keyBuf = new Uint8Array(cap);
184
+ encLen = keyEncoder.encodeInto(key, keyBuf).written;
185
+ encBytes = keyBuf;
186
+ return;
187
+ }
188
+ encBytes = normalize(key);
189
+ encLen = encBytes.length;
190
+ }
191
+ function keyToLanes(key, seed) {
192
+ encodeKey(key);
193
+ computeLanes(encBytes, seed, encLen);
194
+ }
195
+ function hash128KeyInto(key, seed, out) {
196
+ keyToLanes(key, seed);
197
+ out.w0 = LANES.w0;
198
+ out.w1 = LANES.w1;
199
+ out.w2 = LANES.w2;
200
+ out.w3 = LANES.w3;
201
+ }
202
+ function reduce(x, range) {
203
+ const xlo = x & 65535;
204
+ const xhi = x >>> 16;
205
+ const rlo = range & 65535;
206
+ const rhi = range >>> 16;
207
+ const lolo = xlo * rlo;
208
+ const lohi = xlo * rhi;
209
+ const hilo = xhi * rlo;
210
+ const hihi = xhi * rhi;
211
+ const carry = (lolo >>> 16) + (lohi & 65535) + (hilo & 65535);
212
+ return hihi + (lohi >>> 16) + (hilo >>> 16) + (carry >>> 16) >>> 0;
213
+ }
214
+ function hash32x2Into(key, seed, out) {
215
+ keyToLanes(key, seed);
216
+ out[0] = LANES.w0;
217
+ out[1] = LANES.w1;
218
+ }
219
+ function probeInto(key, count, range, seed, out) {
220
+ keyToLanes(key, seed);
221
+ const a = LANES.w0;
222
+ const b = LANES.w1;
223
+ for (let i = 0; i < count; i++) {
224
+ const x = a + Math.imul(i, b) + i * i >>> 0;
225
+ out[i] = reduce(x, range);
226
+ }
227
+ }
228
+ //#endregion
229
+ Object.defineProperty(exports, "RHI", {
230
+ enumerable: true,
231
+ get: function() {
232
+ return RHI;
233
+ }
234
+ });
235
+ Object.defineProperty(exports, "RLO", {
236
+ enumerable: true,
237
+ get: function() {
238
+ return RLO;
239
+ }
240
+ });
241
+ Object.defineProperty(exports, "fmix64", {
242
+ enumerable: true,
243
+ get: function() {
244
+ return fmix64;
245
+ }
246
+ });
247
+ Object.defineProperty(exports, "hash128KeyInto", {
248
+ enumerable: true,
249
+ get: function() {
250
+ return hash128KeyInto;
251
+ }
252
+ });
253
+ Object.defineProperty(exports, "hash32x2Into", {
254
+ enumerable: true,
255
+ get: function() {
256
+ return hash32x2Into;
257
+ }
258
+ });
259
+ Object.defineProperty(exports, "mul64", {
260
+ enumerable: true,
261
+ get: function() {
262
+ return mul64;
263
+ }
264
+ });
265
+ Object.defineProperty(exports, "probeInto", {
266
+ enumerable: true,
267
+ get: function() {
268
+ return probeInto;
269
+ }
270
+ });
271
+ Object.defineProperty(exports, "reduce", {
272
+ enumerable: true,
273
+ get: function() {
274
+ return reduce;
275
+ }
276
+ });
@@ -0,0 +1,229 @@
1
+ //#region src/core/bytes.ts
2
+ const encoder = new TextEncoder();
3
+ function normalize(input) {
4
+ if (typeof input === "string") return encoder.encode(input);
5
+ if (input instanceof Uint8Array) return input;
6
+ return new Uint8Array(input);
7
+ }
8
+ //#endregion
9
+ //#region src/core/hasher.ts
10
+ let RLO = 0;
11
+ let RHI = 0;
12
+ const LANES = {
13
+ w0: 0,
14
+ w1: 0,
15
+ w2: 0,
16
+ w3: 0
17
+ };
18
+ function mul64(alo, ahi, blo, bhi) {
19
+ const a0 = alo & 65535;
20
+ const a1 = alo >>> 16;
21
+ const a2 = ahi & 65535;
22
+ const a3 = ahi >>> 16;
23
+ const b0 = blo & 65535;
24
+ const b1 = blo >>> 16;
25
+ const b2 = bhi & 65535;
26
+ const b3 = bhi >>> 16;
27
+ let c0 = a0 * b0;
28
+ let c1 = c0 >>> 16;
29
+ c0 &= 65535;
30
+ c1 += a1 * b0;
31
+ let c2 = c1 >>> 16;
32
+ c1 &= 65535;
33
+ c1 += a0 * b1;
34
+ c2 += c1 >>> 16;
35
+ c1 &= 65535;
36
+ c2 += a2 * b0;
37
+ let c3 = c2 >>> 16;
38
+ c2 &= 65535;
39
+ c2 += a1 * b1;
40
+ c3 += c2 >>> 16;
41
+ c2 &= 65535;
42
+ c2 += a0 * b2;
43
+ c3 += c2 >>> 16;
44
+ c2 &= 65535;
45
+ c3 += a3 * b0 + a2 * b1 + a1 * b2 + a0 * b3;
46
+ c3 &= 65535;
47
+ RLO = (c1 << 16 | c0) >>> 0;
48
+ RHI = (c3 << 16 | c2) >>> 0;
49
+ }
50
+ function fmix64(lo, hi) {
51
+ let l = lo;
52
+ let h = hi;
53
+ l = (l ^ h >>> 1) >>> 0;
54
+ mul64(l, h, 3981806797, 4283543511);
55
+ l = RLO;
56
+ h = RHI;
57
+ l = (l ^ h >>> 1) >>> 0;
58
+ mul64(l, h, 444984403, 3301882366);
59
+ l = RLO;
60
+ h = RHI;
61
+ l = (l ^ h >>> 1) >>> 0;
62
+ RLO = l;
63
+ RHI = h;
64
+ }
65
+ function rotl32(x, r) {
66
+ return (x << r | x >>> 32 - r) >>> 0;
67
+ }
68
+ function fmix32(h) {
69
+ let x = h;
70
+ x ^= x >>> 16;
71
+ x = Math.imul(x, 2246822507);
72
+ x ^= x >>> 13;
73
+ x = Math.imul(x, 3266489909);
74
+ x ^= x >>> 16;
75
+ return x >>> 0;
76
+ }
77
+ const K1 = 597399067;
78
+ const K2 = 2869860233;
79
+ const K3 = 951274213;
80
+ const K4 = 2716044179;
81
+ function computeLanes(bytes, seed, len) {
82
+ const nblocks = len >>> 4;
83
+ let h1 = seed >>> 0;
84
+ let h2 = seed >>> 0;
85
+ let h3 = seed >>> 0;
86
+ let h4 = seed >>> 0;
87
+ for (let i = 0; i < nblocks; i++) {
88
+ const b = i * 16;
89
+ let k1 = ((bytes[b] ?? 0) | (bytes[b + 1] ?? 0) << 8 | (bytes[b + 2] ?? 0) << 16 | (bytes[b + 3] ?? 0) << 24) >>> 0;
90
+ let k2 = ((bytes[b + 4] ?? 0) | (bytes[b + 5] ?? 0) << 8 | (bytes[b + 6] ?? 0) << 16 | (bytes[b + 7] ?? 0) << 24) >>> 0;
91
+ let k3 = ((bytes[b + 8] ?? 0) | (bytes[b + 9] ?? 0) << 8 | (bytes[b + 10] ?? 0) << 16 | (bytes[b + 11] ?? 0) << 24) >>> 0;
92
+ let k4 = ((bytes[b + 12] ?? 0) | (bytes[b + 13] ?? 0) << 8 | (bytes[b + 14] ?? 0) << 16 | (bytes[b + 15] ?? 0) << 24) >>> 0;
93
+ k1 = Math.imul(rotl32(Math.imul(k1, K1), 15), K2);
94
+ h1 ^= k1;
95
+ h1 = rotl32(h1, 19);
96
+ h1 = h1 + h2 >>> 0;
97
+ h1 = Math.imul(h1, 5) + 1444728091 >>> 0;
98
+ k2 = Math.imul(rotl32(Math.imul(k2, K2), 16), K3);
99
+ h2 ^= k2;
100
+ h2 = rotl32(h2, 17);
101
+ h2 = h2 + h3 >>> 0;
102
+ h2 = Math.imul(h2, 5) + 197830471 >>> 0;
103
+ k3 = Math.imul(rotl32(Math.imul(k3, K3), 17), K4);
104
+ h3 ^= k3;
105
+ h3 = rotl32(h3, 15);
106
+ h3 = h3 + h4 >>> 0;
107
+ h3 = Math.imul(h3, 5) + 2530024501 >>> 0;
108
+ k4 = Math.imul(rotl32(Math.imul(k4, K4), 18), K1);
109
+ h4 ^= k4;
110
+ h4 = rotl32(h4, 13);
111
+ h4 = h4 + h1 >>> 0;
112
+ h4 = Math.imul(h4, 5) + 850148119 >>> 0;
113
+ }
114
+ let k1 = 0;
115
+ let k2 = 0;
116
+ let k3 = 0;
117
+ let k4 = 0;
118
+ const tail = nblocks * 16;
119
+ const rem = len & 15;
120
+ if (rem >= 15) k4 ^= (bytes[tail + 14] ?? 0) << 16;
121
+ if (rem >= 14) k4 ^= (bytes[tail + 13] ?? 0) << 8;
122
+ if (rem >= 13) {
123
+ k4 ^= bytes[tail + 12] ?? 0;
124
+ k4 = Math.imul(rotl32(Math.imul(k4, K4), 18), K1);
125
+ h4 ^= k4;
126
+ }
127
+ if (rem >= 12) k3 ^= (bytes[tail + 11] ?? 0) << 24;
128
+ if (rem >= 11) k3 ^= (bytes[tail + 10] ?? 0) << 16;
129
+ if (rem >= 10) k3 ^= (bytes[tail + 9] ?? 0) << 8;
130
+ if (rem >= 9) {
131
+ k3 ^= bytes[tail + 8] ?? 0;
132
+ k3 = Math.imul(rotl32(Math.imul(k3, K3), 17), K4);
133
+ h3 ^= k3;
134
+ }
135
+ if (rem >= 8) k2 ^= (bytes[tail + 7] ?? 0) << 24;
136
+ if (rem >= 7) k2 ^= (bytes[tail + 6] ?? 0) << 16;
137
+ if (rem >= 6) k2 ^= (bytes[tail + 5] ?? 0) << 8;
138
+ if (rem >= 5) {
139
+ k2 ^= bytes[tail + 4] ?? 0;
140
+ k2 = Math.imul(rotl32(Math.imul(k2, K2), 16), K3);
141
+ h2 ^= k2;
142
+ }
143
+ if (rem >= 4) k1 ^= (bytes[tail + 3] ?? 0) << 24;
144
+ if (rem >= 3) k1 ^= (bytes[tail + 2] ?? 0) << 16;
145
+ if (rem >= 2) k1 ^= (bytes[tail + 1] ?? 0) << 8;
146
+ if (rem >= 1) {
147
+ k1 ^= bytes[tail] ?? 0;
148
+ k1 = Math.imul(rotl32(Math.imul(k1, K1), 15), K2);
149
+ h1 ^= k1;
150
+ }
151
+ h1 = (h1 ^ len) >>> 0;
152
+ h2 = (h2 ^ len) >>> 0;
153
+ h3 = (h3 ^ len) >>> 0;
154
+ h4 = (h4 ^ len) >>> 0;
155
+ h1 = h1 + h2 >>> 0;
156
+ h1 = h1 + h3 >>> 0;
157
+ h1 = h1 + h4 >>> 0;
158
+ h2 = h2 + h1 >>> 0;
159
+ h3 = h3 + h1 >>> 0;
160
+ h4 = h4 + h1 >>> 0;
161
+ h1 = fmix32(h1);
162
+ h2 = fmix32(h2);
163
+ h3 = fmix32(h3);
164
+ h4 = fmix32(h4);
165
+ h1 = h1 + h2 >>> 0;
166
+ h1 = h1 + h3 >>> 0;
167
+ h1 = h1 + h4 >>> 0;
168
+ h2 = h2 + h1 >>> 0;
169
+ h3 = h3 + h1 >>> 0;
170
+ h4 = h4 + h1 >>> 0;
171
+ LANES.w0 = h1;
172
+ LANES.w1 = h2;
173
+ LANES.w2 = h3;
174
+ LANES.w3 = h4;
175
+ }
176
+ const keyEncoder = new TextEncoder();
177
+ let keyBuf = new Uint8Array(256);
178
+ let encBytes = keyBuf;
179
+ let encLen = 0;
180
+ function encodeKey(key) {
181
+ if (typeof key === "string") {
182
+ const cap = key.length * 3;
183
+ if (keyBuf.length < cap) keyBuf = new Uint8Array(cap);
184
+ encLen = keyEncoder.encodeInto(key, keyBuf).written;
185
+ encBytes = keyBuf;
186
+ return;
187
+ }
188
+ encBytes = normalize(key);
189
+ encLen = encBytes.length;
190
+ }
191
+ function keyToLanes(key, seed) {
192
+ encodeKey(key);
193
+ computeLanes(encBytes, seed, encLen);
194
+ }
195
+ function hash128KeyInto(key, seed, out) {
196
+ keyToLanes(key, seed);
197
+ out.w0 = LANES.w0;
198
+ out.w1 = LANES.w1;
199
+ out.w2 = LANES.w2;
200
+ out.w3 = LANES.w3;
201
+ }
202
+ function reduce(x, range) {
203
+ const xlo = x & 65535;
204
+ const xhi = x >>> 16;
205
+ const rlo = range & 65535;
206
+ const rhi = range >>> 16;
207
+ const lolo = xlo * rlo;
208
+ const lohi = xlo * rhi;
209
+ const hilo = xhi * rlo;
210
+ const hihi = xhi * rhi;
211
+ const carry = (lolo >>> 16) + (lohi & 65535) + (hilo & 65535);
212
+ return hihi + (lohi >>> 16) + (hilo >>> 16) + (carry >>> 16) >>> 0;
213
+ }
214
+ function hash32x2Into(key, seed, out) {
215
+ keyToLanes(key, seed);
216
+ out[0] = LANES.w0;
217
+ out[1] = LANES.w1;
218
+ }
219
+ function probeInto(key, count, range, seed, out) {
220
+ keyToLanes(key, seed);
221
+ const a = LANES.w0;
222
+ const b = LANES.w1;
223
+ for (let i = 0; i < count; i++) {
224
+ const x = a + Math.imul(i, b) + i * i >>> 0;
225
+ out[i] = reduce(x, range);
226
+ }
227
+ }
228
+ //#endregion
229
+ export { hash32x2Into as a, reduce as c, hash128KeyInto as i, RLO as n, mul64 as o, fmix64 as r, probeInto as s, RHI as t };