rapidhash-wasm-vn 1.0.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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -0
  3. package/bundler/rapidhash_wasm_vn.d.ts +161 -0
  4. package/bundler/rapidhash_wasm_vn.js +5 -0
  5. package/bundler/rapidhash_wasm_vn_bg.js +539 -0
  6. package/bundler/rapidhash_wasm_vn_bg.wasm +0 -0
  7. package/bundler/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
  8. package/deno/rapidhash_wasm_vn.d.ts +161 -0
  9. package/deno/rapidhash_wasm_vn.js +537 -0
  10. package/deno/rapidhash_wasm_vn_bg.wasm +0 -0
  11. package/deno/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
  12. package/esm/package.json +4 -0
  13. package/esm/rapidhash_wasm_vn.d.ts +161 -0
  14. package/esm/rapidhash_wasm_vn.js +17 -0
  15. package/esm/rapidhash_wasm_vn_bg.js +533 -0
  16. package/esm/rapidhash_wasm_vn_bg.wasm +0 -0
  17. package/esm/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
  18. package/module/rapidhash_wasm_vn.d.ts +161 -0
  19. package/module/rapidhash_wasm_vn.js +538 -0
  20. package/module/rapidhash_wasm_vn_bg.wasm +0 -0
  21. package/module/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
  22. package/no-modules/rapidhash_wasm_vn.d.ts +233 -0
  23. package/no-modules/rapidhash_wasm_vn.js +654 -0
  24. package/no-modules/rapidhash_wasm_vn_bg.wasm +0 -0
  25. package/no-modules/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
  26. package/nodejs/rapidhash_wasm_vn.d.ts +161 -0
  27. package/nodejs/rapidhash_wasm_vn.js +546 -0
  28. package/nodejs/rapidhash_wasm_vn_bg.wasm +0 -0
  29. package/nodejs/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
  30. package/package.json +79 -0
  31. package/web/rapidhash_wasm_vn.d.ts +241 -0
  32. package/web/rapidhash_wasm_vn.js +644 -0
  33. package/web/rapidhash_wasm_vn_bg.wasm +0 -0
  34. package/web/rapidhash_wasm_vn_bg.wasm.d.ts +56 -0
@@ -0,0 +1,161 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Computes RapidHash V1 (64-bit) hash
5
+ *
6
+ * # Arguments
7
+ *
8
+ * * `input` - Input data to hash
9
+ * * `seed` - Seed value for hash (default: 0)
10
+ */
11
+ export function hash_v1(input: Uint8Array, seed?: bigint | null): bigint;
12
+ /**
13
+ * Computes RapidHash V2 (64-bit) hash
14
+ *
15
+ * # Arguments
16
+ *
17
+ * * `input` - Input data to hash
18
+ * * `seed` - Seed value for hash (default: 0)
19
+ */
20
+ export function hash_v2(input: Uint8Array, seed?: bigint | null): bigint;
21
+ /**
22
+ * Computes RapidHash V3 (64-bit) hash
23
+ *
24
+ * # Arguments
25
+ *
26
+ * * `input` - Input data to hash
27
+ * * `seed` - Seed value for hash (default: 0)
28
+ */
29
+ export function hash_v3(input: Uint8Array, seed?: bigint | null): bigint;
30
+ /**
31
+ * Computes RapidHash V3 (64-bit) micro hash
32
+ *
33
+ * # Arguments
34
+ *
35
+ * * `input` - Input data to hash
36
+ * * `seed` - Seed value for hash (default: 0)
37
+ */
38
+ export function hash_v3_micro(input: Uint8Array, seed?: bigint | null): bigint;
39
+ /**
40
+ * Computes RapidHash V3 (64-bit) nano hash
41
+ *
42
+ * # Arguments
43
+ *
44
+ * * `input` - Input data to hash
45
+ * * `seed` - Seed value for hash (default: 0)
46
+ */
47
+ export function hash_v3_nano(input: Uint8Array, seed?: bigint | null): bigint;
48
+ export class FastHasher {
49
+ free(): void;
50
+ [Symbol.dispose](): void;
51
+ constructor(seed?: bigint | null);
52
+ /**
53
+ * Updates the hash with new data
54
+ */
55
+ update(data: Uint8Array): void;
56
+ update_u8(data: number): void;
57
+ update_u16(data: number): void;
58
+ update_u32(data: number): void;
59
+ update_u64(data: bigint): void;
60
+ update_u128(data: bigint): void;
61
+ update_i8(data: number): void;
62
+ update_i16(data: number): void;
63
+ update_i32(data: number): void;
64
+ update_i64(data: bigint): void;
65
+ update_i128(data: bigint): void;
66
+ /**
67
+ * Finalizes the hash and returns the result
68
+ */
69
+ digest(): bigint;
70
+ /**
71
+ * Resets the hasher
72
+ */
73
+ reset(): void;
74
+ }
75
+ /**
76
+ * Streaming PortableHashV1
77
+ */
78
+ export class PortableHashV1 {
79
+ free(): void;
80
+ [Symbol.dispose](): void;
81
+ constructor(seed?: bigint | null);
82
+ /**
83
+ * Updates the hash with new data
84
+ */
85
+ update(data: Uint8Array): void;
86
+ /**
87
+ * Finalizes the hash and returns the result
88
+ */
89
+ digest(): bigint;
90
+ /**
91
+ * Resets the hasher with optional new seed
92
+ */
93
+ reset(): void;
94
+ }
95
+ /**
96
+ * Streaming PortableHashV2
97
+ */
98
+ export class PortableHashV2 {
99
+ free(): void;
100
+ [Symbol.dispose](): void;
101
+ constructor(seed?: bigint | null);
102
+ /**
103
+ * Updates the hash with new data
104
+ */
105
+ update(data: Uint8Array): void;
106
+ /**
107
+ * Finalizes the hash and returns the result
108
+ */
109
+ digest(): bigint;
110
+ /**
111
+ * Resets the hasher with optional new seed
112
+ */
113
+ reset(): void;
114
+ }
115
+ /**
116
+ * Streaming PortableHashV3
117
+ */
118
+ export class PortableHashV3 {
119
+ free(): void;
120
+ [Symbol.dispose](): void;
121
+ constructor(seed?: bigint | null);
122
+ /**
123
+ * Updates the hash with new data
124
+ */
125
+ update(data: Uint8Array): void;
126
+ /**
127
+ * Finalizes the hash and returns the result
128
+ */
129
+ digest(): bigint;
130
+ /**
131
+ * Resets the hasher with optional new seed
132
+ */
133
+ reset(): void;
134
+ }
135
+ export class QualityHasher {
136
+ free(): void;
137
+ [Symbol.dispose](): void;
138
+ constructor(seed?: bigint | null);
139
+ /**
140
+ * Updates the hash with new data
141
+ */
142
+ update(data: Uint8Array): void;
143
+ update_u8(data: number): void;
144
+ update_u16(data: number): void;
145
+ update_u32(data: number): void;
146
+ update_u64(data: bigint): void;
147
+ update_u128(data: bigint): void;
148
+ update_i8(data: number): void;
149
+ update_i16(data: number): void;
150
+ update_i32(data: number): void;
151
+ update_i64(data: bigint): void;
152
+ update_i128(data: bigint): void;
153
+ /**
154
+ * Finalizes the hash and returns the result
155
+ */
156
+ digest(): bigint;
157
+ /**
158
+ * Resets the hasher
159
+ */
160
+ reset(): void;
161
+ }
@@ -0,0 +1,537 @@
1
+
2
+
3
+ let cachedUint8ArrayMemory0 = null;
4
+
5
+ function getUint8ArrayMemory0() {
6
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
7
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
8
+ }
9
+ return cachedUint8ArrayMemory0;
10
+ }
11
+
12
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
13
+
14
+ cachedTextDecoder.decode();
15
+
16
+ function decodeText(ptr, len) {
17
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
18
+ }
19
+
20
+ function getStringFromWasm0(ptr, len) {
21
+ ptr = ptr >>> 0;
22
+ return decodeText(ptr, len);
23
+ }
24
+
25
+ let WASM_VECTOR_LEN = 0;
26
+
27
+ function passArray8ToWasm0(arg, malloc) {
28
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
29
+ getUint8ArrayMemory0().set(arg, ptr / 1);
30
+ WASM_VECTOR_LEN = arg.length;
31
+ return ptr;
32
+ }
33
+
34
+ function isLikeNone(x) {
35
+ return x === undefined || x === null;
36
+ }
37
+ /**
38
+ * Computes RapidHash V1 (64-bit) hash
39
+ *
40
+ * # Arguments
41
+ *
42
+ * * `input` - Input data to hash
43
+ * * `seed` - Seed value for hash (default: 0)
44
+ * @param {Uint8Array} input
45
+ * @param {bigint | null} [seed]
46
+ * @returns {bigint}
47
+ */
48
+ export function hash_v1(input, seed) {
49
+ const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
50
+ const len0 = WASM_VECTOR_LEN;
51
+ const ret = wasm.hash_v1(ptr0, len0, !isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
52
+ return BigInt.asUintN(64, ret);
53
+ }
54
+
55
+ /**
56
+ * Computes RapidHash V2 (64-bit) hash
57
+ *
58
+ * # Arguments
59
+ *
60
+ * * `input` - Input data to hash
61
+ * * `seed` - Seed value for hash (default: 0)
62
+ * @param {Uint8Array} input
63
+ * @param {bigint | null} [seed]
64
+ * @returns {bigint}
65
+ */
66
+ export function hash_v2(input, seed) {
67
+ const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
68
+ const len0 = WASM_VECTOR_LEN;
69
+ const ret = wasm.hash_v2(ptr0, len0, !isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
70
+ return BigInt.asUintN(64, ret);
71
+ }
72
+
73
+ /**
74
+ * Computes RapidHash V3 (64-bit) hash
75
+ *
76
+ * # Arguments
77
+ *
78
+ * * `input` - Input data to hash
79
+ * * `seed` - Seed value for hash (default: 0)
80
+ * @param {Uint8Array} input
81
+ * @param {bigint | null} [seed]
82
+ * @returns {bigint}
83
+ */
84
+ export function hash_v3(input, seed) {
85
+ const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
86
+ const len0 = WASM_VECTOR_LEN;
87
+ const ret = wasm.hash_v3(ptr0, len0, !isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
88
+ return BigInt.asUintN(64, ret);
89
+ }
90
+
91
+ /**
92
+ * Computes RapidHash V3 (64-bit) micro hash
93
+ *
94
+ * # Arguments
95
+ *
96
+ * * `input` - Input data to hash
97
+ * * `seed` - Seed value for hash (default: 0)
98
+ * @param {Uint8Array} input
99
+ * @param {bigint | null} [seed]
100
+ * @returns {bigint}
101
+ */
102
+ export function hash_v3_micro(input, seed) {
103
+ const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
104
+ const len0 = WASM_VECTOR_LEN;
105
+ const ret = wasm.hash_v3_micro(ptr0, len0, !isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
106
+ return BigInt.asUintN(64, ret);
107
+ }
108
+
109
+ /**
110
+ * Computes RapidHash V3 (64-bit) nano hash
111
+ *
112
+ * # Arguments
113
+ *
114
+ * * `input` - Input data to hash
115
+ * * `seed` - Seed value for hash (default: 0)
116
+ * @param {Uint8Array} input
117
+ * @param {bigint | null} [seed]
118
+ * @returns {bigint}
119
+ */
120
+ export function hash_v3_nano(input, seed) {
121
+ const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
122
+ const len0 = WASM_VECTOR_LEN;
123
+ const ret = wasm.hash_v3_nano(ptr0, len0, !isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
124
+ return BigInt.asUintN(64, ret);
125
+ }
126
+
127
+ const FastHasherFinalization = (typeof FinalizationRegistry === 'undefined')
128
+ ? { register: () => {}, unregister: () => {} }
129
+ : new FinalizationRegistry(ptr => wasm.__wbg_fasthasher_free(ptr >>> 0, 1));
130
+
131
+ export class FastHasher {
132
+
133
+ __destroy_into_raw() {
134
+ const ptr = this.__wbg_ptr;
135
+ this.__wbg_ptr = 0;
136
+ FastHasherFinalization.unregister(this);
137
+ return ptr;
138
+ }
139
+
140
+ free() {
141
+ const ptr = this.__destroy_into_raw();
142
+ wasm.__wbg_fasthasher_free(ptr, 0);
143
+ }
144
+ /**
145
+ * @param {bigint | null} [seed]
146
+ */
147
+ constructor(seed) {
148
+ const ret = wasm.fasthasher_new(!isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
149
+ this.__wbg_ptr = ret >>> 0;
150
+ FastHasherFinalization.register(this, this.__wbg_ptr, this);
151
+ return this;
152
+ }
153
+ /**
154
+ * Updates the hash with new data
155
+ * @param {Uint8Array} data
156
+ */
157
+ update(data) {
158
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
159
+ const len0 = WASM_VECTOR_LEN;
160
+ wasm.fasthasher_update(this.__wbg_ptr, ptr0, len0);
161
+ }
162
+ /**
163
+ * @param {number} data
164
+ */
165
+ update_u8(data) {
166
+ wasm.fasthasher_update_i8(this.__wbg_ptr, data);
167
+ }
168
+ /**
169
+ * @param {number} data
170
+ */
171
+ update_u16(data) {
172
+ wasm.fasthasher_update_i16(this.__wbg_ptr, data);
173
+ }
174
+ /**
175
+ * @param {number} data
176
+ */
177
+ update_u32(data) {
178
+ wasm.fasthasher_update_i32(this.__wbg_ptr, data);
179
+ }
180
+ /**
181
+ * @param {bigint} data
182
+ */
183
+ update_u64(data) {
184
+ wasm.fasthasher_update_i64(this.__wbg_ptr, data);
185
+ }
186
+ /**
187
+ * @param {bigint} data
188
+ */
189
+ update_u128(data) {
190
+ wasm.fasthasher_update_i128(this.__wbg_ptr, data, data >> BigInt(64));
191
+ }
192
+ /**
193
+ * @param {number} data
194
+ */
195
+ update_i8(data) {
196
+ wasm.fasthasher_update_i8(this.__wbg_ptr, data);
197
+ }
198
+ /**
199
+ * @param {number} data
200
+ */
201
+ update_i16(data) {
202
+ wasm.fasthasher_update_i16(this.__wbg_ptr, data);
203
+ }
204
+ /**
205
+ * @param {number} data
206
+ */
207
+ update_i32(data) {
208
+ wasm.fasthasher_update_i32(this.__wbg_ptr, data);
209
+ }
210
+ /**
211
+ * @param {bigint} data
212
+ */
213
+ update_i64(data) {
214
+ wasm.fasthasher_update_i64(this.__wbg_ptr, data);
215
+ }
216
+ /**
217
+ * @param {bigint} data
218
+ */
219
+ update_i128(data) {
220
+ wasm.fasthasher_update_i128(this.__wbg_ptr, data, data >> BigInt(64));
221
+ }
222
+ /**
223
+ * Finalizes the hash and returns the result
224
+ * @returns {bigint}
225
+ */
226
+ digest() {
227
+ const ret = wasm.fasthasher_digest(this.__wbg_ptr);
228
+ return BigInt.asUintN(64, ret);
229
+ }
230
+ /**
231
+ * Resets the hasher
232
+ */
233
+ reset() {
234
+ wasm.fasthasher_reset(this.__wbg_ptr);
235
+ }
236
+ }
237
+ if (Symbol.dispose) FastHasher.prototype[Symbol.dispose] = FastHasher.prototype.free;
238
+
239
+ const PortableHashV1Finalization = (typeof FinalizationRegistry === 'undefined')
240
+ ? { register: () => {}, unregister: () => {} }
241
+ : new FinalizationRegistry(ptr => wasm.__wbg_portablehashv1_free(ptr >>> 0, 1));
242
+ /**
243
+ * Streaming PortableHashV1
244
+ */
245
+ export class PortableHashV1 {
246
+
247
+ __destroy_into_raw() {
248
+ const ptr = this.__wbg_ptr;
249
+ this.__wbg_ptr = 0;
250
+ PortableHashV1Finalization.unregister(this);
251
+ return ptr;
252
+ }
253
+
254
+ free() {
255
+ const ptr = this.__destroy_into_raw();
256
+ wasm.__wbg_portablehashv1_free(ptr, 0);
257
+ }
258
+ /**
259
+ * @param {bigint | null} [seed]
260
+ */
261
+ constructor(seed) {
262
+ const ret = wasm.portablehashv1_new(!isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
263
+ this.__wbg_ptr = ret >>> 0;
264
+ PortableHashV1Finalization.register(this, this.__wbg_ptr, this);
265
+ return this;
266
+ }
267
+ /**
268
+ * Updates the hash with new data
269
+ * @param {Uint8Array} data
270
+ */
271
+ update(data) {
272
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
273
+ const len0 = WASM_VECTOR_LEN;
274
+ wasm.portablehashv1_update(this.__wbg_ptr, ptr0, len0);
275
+ }
276
+ /**
277
+ * Finalizes the hash and returns the result
278
+ * @returns {bigint}
279
+ */
280
+ digest() {
281
+ const ret = wasm.portablehashv1_digest(this.__wbg_ptr);
282
+ return BigInt.asUintN(64, ret);
283
+ }
284
+ /**
285
+ * Resets the hasher with optional new seed
286
+ */
287
+ reset() {
288
+ wasm.portablehashv1_reset(this.__wbg_ptr);
289
+ }
290
+ }
291
+ if (Symbol.dispose) PortableHashV1.prototype[Symbol.dispose] = PortableHashV1.prototype.free;
292
+
293
+ const PortableHashV2Finalization = (typeof FinalizationRegistry === 'undefined')
294
+ ? { register: () => {}, unregister: () => {} }
295
+ : new FinalizationRegistry(ptr => wasm.__wbg_portablehashv2_free(ptr >>> 0, 1));
296
+ /**
297
+ * Streaming PortableHashV2
298
+ */
299
+ export class PortableHashV2 {
300
+
301
+ __destroy_into_raw() {
302
+ const ptr = this.__wbg_ptr;
303
+ this.__wbg_ptr = 0;
304
+ PortableHashV2Finalization.unregister(this);
305
+ return ptr;
306
+ }
307
+
308
+ free() {
309
+ const ptr = this.__destroy_into_raw();
310
+ wasm.__wbg_portablehashv2_free(ptr, 0);
311
+ }
312
+ /**
313
+ * @param {bigint | null} [seed]
314
+ */
315
+ constructor(seed) {
316
+ const ret = wasm.portablehashv2_new(!isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
317
+ this.__wbg_ptr = ret >>> 0;
318
+ PortableHashV2Finalization.register(this, this.__wbg_ptr, this);
319
+ return this;
320
+ }
321
+ /**
322
+ * Updates the hash with new data
323
+ * @param {Uint8Array} data
324
+ */
325
+ update(data) {
326
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
327
+ const len0 = WASM_VECTOR_LEN;
328
+ wasm.portablehashv2_update(this.__wbg_ptr, ptr0, len0);
329
+ }
330
+ /**
331
+ * Finalizes the hash and returns the result
332
+ * @returns {bigint}
333
+ */
334
+ digest() {
335
+ const ret = wasm.portablehashv2_digest(this.__wbg_ptr);
336
+ return BigInt.asUintN(64, ret);
337
+ }
338
+ /**
339
+ * Resets the hasher with optional new seed
340
+ */
341
+ reset() {
342
+ wasm.portablehashv2_reset(this.__wbg_ptr);
343
+ }
344
+ }
345
+ if (Symbol.dispose) PortableHashV2.prototype[Symbol.dispose] = PortableHashV2.prototype.free;
346
+
347
+ const PortableHashV3Finalization = (typeof FinalizationRegistry === 'undefined')
348
+ ? { register: () => {}, unregister: () => {} }
349
+ : new FinalizationRegistry(ptr => wasm.__wbg_portablehashv3_free(ptr >>> 0, 1));
350
+ /**
351
+ * Streaming PortableHashV3
352
+ */
353
+ export class PortableHashV3 {
354
+
355
+ __destroy_into_raw() {
356
+ const ptr = this.__wbg_ptr;
357
+ this.__wbg_ptr = 0;
358
+ PortableHashV3Finalization.unregister(this);
359
+ return ptr;
360
+ }
361
+
362
+ free() {
363
+ const ptr = this.__destroy_into_raw();
364
+ wasm.__wbg_portablehashv3_free(ptr, 0);
365
+ }
366
+ /**
367
+ * @param {bigint | null} [seed]
368
+ */
369
+ constructor(seed) {
370
+ const ret = wasm.portablehashv2_new(!isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
371
+ this.__wbg_ptr = ret >>> 0;
372
+ PortableHashV3Finalization.register(this, this.__wbg_ptr, this);
373
+ return this;
374
+ }
375
+ /**
376
+ * Updates the hash with new data
377
+ * @param {Uint8Array} data
378
+ */
379
+ update(data) {
380
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
381
+ const len0 = WASM_VECTOR_LEN;
382
+ wasm.portablehashv2_update(this.__wbg_ptr, ptr0, len0);
383
+ }
384
+ /**
385
+ * Finalizes the hash and returns the result
386
+ * @returns {bigint}
387
+ */
388
+ digest() {
389
+ const ret = wasm.portablehashv3_digest(this.__wbg_ptr);
390
+ return BigInt.asUintN(64, ret);
391
+ }
392
+ /**
393
+ * Resets the hasher with optional new seed
394
+ */
395
+ reset() {
396
+ wasm.portablehashv2_reset(this.__wbg_ptr);
397
+ }
398
+ }
399
+ if (Symbol.dispose) PortableHashV3.prototype[Symbol.dispose] = PortableHashV3.prototype.free;
400
+
401
+ const QualityHasherFinalization = (typeof FinalizationRegistry === 'undefined')
402
+ ? { register: () => {}, unregister: () => {} }
403
+ : new FinalizationRegistry(ptr => wasm.__wbg_qualityhasher_free(ptr >>> 0, 1));
404
+
405
+ export class QualityHasher {
406
+
407
+ __destroy_into_raw() {
408
+ const ptr = this.__wbg_ptr;
409
+ this.__wbg_ptr = 0;
410
+ QualityHasherFinalization.unregister(this);
411
+ return ptr;
412
+ }
413
+
414
+ free() {
415
+ const ptr = this.__destroy_into_raw();
416
+ wasm.__wbg_qualityhasher_free(ptr, 0);
417
+ }
418
+ /**
419
+ * @param {bigint | null} [seed]
420
+ */
421
+ constructor(seed) {
422
+ const ret = wasm.fasthasher_new(!isLikeNone(seed), isLikeNone(seed) ? BigInt(0) : seed);
423
+ this.__wbg_ptr = ret >>> 0;
424
+ QualityHasherFinalization.register(this, this.__wbg_ptr, this);
425
+ return this;
426
+ }
427
+ /**
428
+ * Updates the hash with new data
429
+ * @param {Uint8Array} data
430
+ */
431
+ update(data) {
432
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
433
+ const len0 = WASM_VECTOR_LEN;
434
+ wasm.qualityhasher_update(this.__wbg_ptr, ptr0, len0);
435
+ }
436
+ /**
437
+ * @param {number} data
438
+ */
439
+ update_u8(data) {
440
+ wasm.fasthasher_update_i8(this.__wbg_ptr, data);
441
+ }
442
+ /**
443
+ * @param {number} data
444
+ */
445
+ update_u16(data) {
446
+ wasm.fasthasher_update_i16(this.__wbg_ptr, data);
447
+ }
448
+ /**
449
+ * @param {number} data
450
+ */
451
+ update_u32(data) {
452
+ wasm.fasthasher_update_i32(this.__wbg_ptr, data);
453
+ }
454
+ /**
455
+ * @param {bigint} data
456
+ */
457
+ update_u64(data) {
458
+ wasm.fasthasher_update_i64(this.__wbg_ptr, data);
459
+ }
460
+ /**
461
+ * @param {bigint} data
462
+ */
463
+ update_u128(data) {
464
+ wasm.fasthasher_update_i128(this.__wbg_ptr, data, data >> BigInt(64));
465
+ }
466
+ /**
467
+ * @param {number} data
468
+ */
469
+ update_i8(data) {
470
+ wasm.fasthasher_update_i8(this.__wbg_ptr, data);
471
+ }
472
+ /**
473
+ * @param {number} data
474
+ */
475
+ update_i16(data) {
476
+ wasm.fasthasher_update_i16(this.__wbg_ptr, data);
477
+ }
478
+ /**
479
+ * @param {number} data
480
+ */
481
+ update_i32(data) {
482
+ wasm.fasthasher_update_i32(this.__wbg_ptr, data);
483
+ }
484
+ /**
485
+ * @param {bigint} data
486
+ */
487
+ update_i64(data) {
488
+ wasm.fasthasher_update_i64(this.__wbg_ptr, data);
489
+ }
490
+ /**
491
+ * @param {bigint} data
492
+ */
493
+ update_i128(data) {
494
+ wasm.fasthasher_update_i128(this.__wbg_ptr, data, data >> BigInt(64));
495
+ }
496
+ /**
497
+ * Finalizes the hash and returns the result
498
+ * @returns {bigint}
499
+ */
500
+ digest() {
501
+ const ret = wasm.qualityhasher_digest(this.__wbg_ptr);
502
+ return BigInt.asUintN(64, ret);
503
+ }
504
+ /**
505
+ * Resets the hasher
506
+ */
507
+ reset() {
508
+ wasm.fasthasher_reset(this.__wbg_ptr);
509
+ }
510
+ }
511
+ if (Symbol.dispose) QualityHasher.prototype[Symbol.dispose] = QualityHasher.prototype.free;
512
+
513
+ const imports = {
514
+ __wbindgen_placeholder__: {
515
+ __wbg_wbindgenthrow_451ec1a8469d7eb6: function(arg0, arg1) {
516
+ throw new Error(getStringFromWasm0(arg0, arg1));
517
+ },
518
+ __wbindgen_init_externref_table: function() {
519
+ const table = wasm.__wbindgen_export_0;
520
+ const offset = table.grow(4);
521
+ table.set(0, undefined);
522
+ table.set(offset + 0, undefined);
523
+ table.set(offset + 1, null);
524
+ table.set(offset + 2, true);
525
+ table.set(offset + 3, false);
526
+ ;
527
+ },
528
+ },
529
+
530
+ };
531
+
532
+ const wasmUrl = new URL('rapidhash_wasm_vn_bg.wasm', import.meta.url);
533
+ const wasm = (await WebAssembly.instantiateStreaming(fetch(wasmUrl), imports)).instance.exports;
534
+ export { wasm as __wasm };
535
+
536
+ wasm.__wbindgen_start();
537
+
Binary file