@rasmx/hash 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.
- package/LICENSE +22 -0
- package/README.md +36 -0
- package/index.d.ts +106 -0
- package/index.js +140 -0
- package/package.json +37 -0
- package/pkg/rasmx_hash.d.ts +323 -0
- package/pkg/rasmx_hash.js +1312 -0
- package/pkg/rasmx_hash_bg.wasm +0 -0
|
@@ -0,0 +1,1312 @@
|
|
|
1
|
+
/* @ts-self-types="./rasmx_hash.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class IncrementalBlake3 {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
IncrementalBlake3Finalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_incrementalblake3_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
finalize() {
|
|
18
|
+
let deferred1_0;
|
|
19
|
+
let deferred1_1;
|
|
20
|
+
try {
|
|
21
|
+
const ptr = this.__destroy_into_raw();
|
|
22
|
+
const ret = wasm.incrementalblake3_finalize(ptr);
|
|
23
|
+
deferred1_0 = ret[0];
|
|
24
|
+
deferred1_1 = ret[1];
|
|
25
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
26
|
+
} finally {
|
|
27
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
const ret = wasm.incrementalblake3_new();
|
|
32
|
+
this.__wbg_ptr = ret >>> 0;
|
|
33
|
+
IncrementalBlake3Finalization.register(this, this.__wbg_ptr, this);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @param {Uint8Array} data
|
|
38
|
+
*/
|
|
39
|
+
update(data) {
|
|
40
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
41
|
+
const len0 = WASM_VECTOR_LEN;
|
|
42
|
+
wasm.incrementalblake3_update(this.__wbg_ptr, ptr0, len0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (Symbol.dispose) IncrementalBlake3.prototype[Symbol.dispose] = IncrementalBlake3.prototype.free;
|
|
46
|
+
|
|
47
|
+
export class IncrementalKeccak256 {
|
|
48
|
+
__destroy_into_raw() {
|
|
49
|
+
const ptr = this.__wbg_ptr;
|
|
50
|
+
this.__wbg_ptr = 0;
|
|
51
|
+
IncrementalKeccak256Finalization.unregister(this);
|
|
52
|
+
return ptr;
|
|
53
|
+
}
|
|
54
|
+
free() {
|
|
55
|
+
const ptr = this.__destroy_into_raw();
|
|
56
|
+
wasm.__wbg_incrementalkeccak256_free(ptr, 0);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @returns {string}
|
|
60
|
+
*/
|
|
61
|
+
finalize() {
|
|
62
|
+
let deferred1_0;
|
|
63
|
+
let deferred1_1;
|
|
64
|
+
try {
|
|
65
|
+
const ptr = this.__destroy_into_raw();
|
|
66
|
+
const ret = wasm.incrementalkeccak256_finalize(ptr);
|
|
67
|
+
deferred1_0 = ret[0];
|
|
68
|
+
deferred1_1 = ret[1];
|
|
69
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
70
|
+
} finally {
|
|
71
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
constructor() {
|
|
75
|
+
const ret = wasm.incrementalkeccak256_new();
|
|
76
|
+
this.__wbg_ptr = ret >>> 0;
|
|
77
|
+
IncrementalKeccak256Finalization.register(this, this.__wbg_ptr, this);
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @param {Uint8Array} data
|
|
82
|
+
*/
|
|
83
|
+
update(data) {
|
|
84
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
85
|
+
const len0 = WASM_VECTOR_LEN;
|
|
86
|
+
wasm.incrementalkeccak256_update(this.__wbg_ptr, ptr0, len0);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (Symbol.dispose) IncrementalKeccak256.prototype[Symbol.dispose] = IncrementalKeccak256.prototype.free;
|
|
90
|
+
|
|
91
|
+
export class IncrementalMd5 {
|
|
92
|
+
__destroy_into_raw() {
|
|
93
|
+
const ptr = this.__wbg_ptr;
|
|
94
|
+
this.__wbg_ptr = 0;
|
|
95
|
+
IncrementalMd5Finalization.unregister(this);
|
|
96
|
+
return ptr;
|
|
97
|
+
}
|
|
98
|
+
free() {
|
|
99
|
+
const ptr = this.__destroy_into_raw();
|
|
100
|
+
wasm.__wbg_incrementalmd5_free(ptr, 0);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @returns {string}
|
|
104
|
+
*/
|
|
105
|
+
finalize() {
|
|
106
|
+
let deferred1_0;
|
|
107
|
+
let deferred1_1;
|
|
108
|
+
try {
|
|
109
|
+
const ptr = this.__destroy_into_raw();
|
|
110
|
+
const ret = wasm.incrementalmd5_finalize(ptr);
|
|
111
|
+
deferred1_0 = ret[0];
|
|
112
|
+
deferred1_1 = ret[1];
|
|
113
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
114
|
+
} finally {
|
|
115
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
constructor() {
|
|
119
|
+
const ret = wasm.incrementalmd5_new();
|
|
120
|
+
this.__wbg_ptr = ret >>> 0;
|
|
121
|
+
IncrementalMd5Finalization.register(this, this.__wbg_ptr, this);
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @param {Uint8Array} data
|
|
126
|
+
*/
|
|
127
|
+
update(data) {
|
|
128
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
130
|
+
wasm.incrementalmd5_update(this.__wbg_ptr, ptr0, len0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (Symbol.dispose) IncrementalMd5.prototype[Symbol.dispose] = IncrementalMd5.prototype.free;
|
|
134
|
+
|
|
135
|
+
export class IncrementalSha256 {
|
|
136
|
+
__destroy_into_raw() {
|
|
137
|
+
const ptr = this.__wbg_ptr;
|
|
138
|
+
this.__wbg_ptr = 0;
|
|
139
|
+
IncrementalSha256Finalization.unregister(this);
|
|
140
|
+
return ptr;
|
|
141
|
+
}
|
|
142
|
+
free() {
|
|
143
|
+
const ptr = this.__destroy_into_raw();
|
|
144
|
+
wasm.__wbg_incrementalsha256_free(ptr, 0);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @returns {string}
|
|
148
|
+
*/
|
|
149
|
+
finalize() {
|
|
150
|
+
let deferred1_0;
|
|
151
|
+
let deferred1_1;
|
|
152
|
+
try {
|
|
153
|
+
const ptr = this.__destroy_into_raw();
|
|
154
|
+
const ret = wasm.incrementalsha256_finalize(ptr);
|
|
155
|
+
deferred1_0 = ret[0];
|
|
156
|
+
deferred1_1 = ret[1];
|
|
157
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
158
|
+
} finally {
|
|
159
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
constructor() {
|
|
163
|
+
const ret = wasm.incrementalsha256_new();
|
|
164
|
+
this.__wbg_ptr = ret >>> 0;
|
|
165
|
+
IncrementalSha256Finalization.register(this, this.__wbg_ptr, this);
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* @param {Uint8Array} data
|
|
170
|
+
*/
|
|
171
|
+
update(data) {
|
|
172
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
173
|
+
const len0 = WASM_VECTOR_LEN;
|
|
174
|
+
wasm.incrementalsha256_update(this.__wbg_ptr, ptr0, len0);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (Symbol.dispose) IncrementalSha256.prototype[Symbol.dispose] = IncrementalSha256.prototype.free;
|
|
178
|
+
|
|
179
|
+
export class IncrementalSha3_256 {
|
|
180
|
+
__destroy_into_raw() {
|
|
181
|
+
const ptr = this.__wbg_ptr;
|
|
182
|
+
this.__wbg_ptr = 0;
|
|
183
|
+
IncrementalSha3_256Finalization.unregister(this);
|
|
184
|
+
return ptr;
|
|
185
|
+
}
|
|
186
|
+
free() {
|
|
187
|
+
const ptr = this.__destroy_into_raw();
|
|
188
|
+
wasm.__wbg_incrementalsha3_256_free(ptr, 0);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @returns {string}
|
|
192
|
+
*/
|
|
193
|
+
finalize() {
|
|
194
|
+
let deferred1_0;
|
|
195
|
+
let deferred1_1;
|
|
196
|
+
try {
|
|
197
|
+
const ptr = this.__destroy_into_raw();
|
|
198
|
+
const ret = wasm.incrementalsha3_256_finalize(ptr);
|
|
199
|
+
deferred1_0 = ret[0];
|
|
200
|
+
deferred1_1 = ret[1];
|
|
201
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
202
|
+
} finally {
|
|
203
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
constructor() {
|
|
207
|
+
const ret = wasm.incrementalkeccak256_new();
|
|
208
|
+
this.__wbg_ptr = ret >>> 0;
|
|
209
|
+
IncrementalSha3_256Finalization.register(this, this.__wbg_ptr, this);
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* @param {Uint8Array} data
|
|
214
|
+
*/
|
|
215
|
+
update(data) {
|
|
216
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
217
|
+
const len0 = WASM_VECTOR_LEN;
|
|
218
|
+
wasm.incrementalkeccak256_update(this.__wbg_ptr, ptr0, len0);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (Symbol.dispose) IncrementalSha3_256.prototype[Symbol.dispose] = IncrementalSha3_256.prototype.free;
|
|
222
|
+
|
|
223
|
+
export class IncrementalSha512 {
|
|
224
|
+
__destroy_into_raw() {
|
|
225
|
+
const ptr = this.__wbg_ptr;
|
|
226
|
+
this.__wbg_ptr = 0;
|
|
227
|
+
IncrementalSha512Finalization.unregister(this);
|
|
228
|
+
return ptr;
|
|
229
|
+
}
|
|
230
|
+
free() {
|
|
231
|
+
const ptr = this.__destroy_into_raw();
|
|
232
|
+
wasm.__wbg_incrementalsha512_free(ptr, 0);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* @returns {string}
|
|
236
|
+
*/
|
|
237
|
+
finalize() {
|
|
238
|
+
let deferred1_0;
|
|
239
|
+
let deferred1_1;
|
|
240
|
+
try {
|
|
241
|
+
const ptr = this.__destroy_into_raw();
|
|
242
|
+
const ret = wasm.incrementalsha512_finalize(ptr);
|
|
243
|
+
deferred1_0 = ret[0];
|
|
244
|
+
deferred1_1 = ret[1];
|
|
245
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
246
|
+
} finally {
|
|
247
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
constructor() {
|
|
251
|
+
const ret = wasm.incrementalsha512_new();
|
|
252
|
+
this.__wbg_ptr = ret >>> 0;
|
|
253
|
+
IncrementalSha512Finalization.register(this, this.__wbg_ptr, this);
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* @param {Uint8Array} data
|
|
258
|
+
*/
|
|
259
|
+
update(data) {
|
|
260
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
261
|
+
const len0 = WASM_VECTOR_LEN;
|
|
262
|
+
wasm.incrementalsha512_update(this.__wbg_ptr, ptr0, len0);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (Symbol.dispose) IncrementalSha512.prototype[Symbol.dispose] = IncrementalSha512.prototype.free;
|
|
266
|
+
|
|
267
|
+
export class IncrementalXxh3 {
|
|
268
|
+
__destroy_into_raw() {
|
|
269
|
+
const ptr = this.__wbg_ptr;
|
|
270
|
+
this.__wbg_ptr = 0;
|
|
271
|
+
IncrementalXxh3Finalization.unregister(this);
|
|
272
|
+
return ptr;
|
|
273
|
+
}
|
|
274
|
+
free() {
|
|
275
|
+
const ptr = this.__destroy_into_raw();
|
|
276
|
+
wasm.__wbg_incrementalxxh3_free(ptr, 0);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @returns {string}
|
|
280
|
+
*/
|
|
281
|
+
finalize_128() {
|
|
282
|
+
let deferred1_0;
|
|
283
|
+
let deferred1_1;
|
|
284
|
+
try {
|
|
285
|
+
const ptr = this.__destroy_into_raw();
|
|
286
|
+
const ret = wasm.incrementalxxh3_finalize_128(ptr);
|
|
287
|
+
deferred1_0 = ret[0];
|
|
288
|
+
deferred1_1 = ret[1];
|
|
289
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
290
|
+
} finally {
|
|
291
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* @returns {string}
|
|
296
|
+
*/
|
|
297
|
+
finalize_64() {
|
|
298
|
+
let deferred1_0;
|
|
299
|
+
let deferred1_1;
|
|
300
|
+
try {
|
|
301
|
+
const ptr = this.__destroy_into_raw();
|
|
302
|
+
const ret = wasm.incrementalxxh3_finalize_64(ptr);
|
|
303
|
+
deferred1_0 = ret[0];
|
|
304
|
+
deferred1_1 = ret[1];
|
|
305
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
306
|
+
} finally {
|
|
307
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
constructor() {
|
|
311
|
+
const ret = wasm.incrementalxxh3_new();
|
|
312
|
+
this.__wbg_ptr = ret >>> 0;
|
|
313
|
+
IncrementalXxh3Finalization.register(this, this.__wbg_ptr, this);
|
|
314
|
+
return this;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @param {Uint8Array} data
|
|
318
|
+
*/
|
|
319
|
+
update(data) {
|
|
320
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
321
|
+
const len0 = WASM_VECTOR_LEN;
|
|
322
|
+
wasm.incrementalxxh3_update(this.__wbg_ptr, ptr0, len0);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (Symbol.dispose) IncrementalXxh3.prototype[Symbol.dispose] = IncrementalXxh3.prototype.free;
|
|
326
|
+
|
|
327
|
+
export class IncrementalXxh32 {
|
|
328
|
+
__destroy_into_raw() {
|
|
329
|
+
const ptr = this.__wbg_ptr;
|
|
330
|
+
this.__wbg_ptr = 0;
|
|
331
|
+
IncrementalXxh32Finalization.unregister(this);
|
|
332
|
+
return ptr;
|
|
333
|
+
}
|
|
334
|
+
free() {
|
|
335
|
+
const ptr = this.__destroy_into_raw();
|
|
336
|
+
wasm.__wbg_incrementalxxh32_free(ptr, 0);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @returns {string}
|
|
340
|
+
*/
|
|
341
|
+
finalize() {
|
|
342
|
+
let deferred1_0;
|
|
343
|
+
let deferred1_1;
|
|
344
|
+
try {
|
|
345
|
+
const ptr = this.__destroy_into_raw();
|
|
346
|
+
const ret = wasm.incrementalxxh32_finalize(ptr);
|
|
347
|
+
deferred1_0 = ret[0];
|
|
348
|
+
deferred1_1 = ret[1];
|
|
349
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
350
|
+
} finally {
|
|
351
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* @param {number} seed
|
|
356
|
+
*/
|
|
357
|
+
constructor(seed) {
|
|
358
|
+
const ret = wasm.incrementalxxh32_new(seed);
|
|
359
|
+
this.__wbg_ptr = ret >>> 0;
|
|
360
|
+
IncrementalXxh32Finalization.register(this, this.__wbg_ptr, this);
|
|
361
|
+
return this;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* @param {Uint8Array} data
|
|
365
|
+
*/
|
|
366
|
+
update(data) {
|
|
367
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
368
|
+
const len0 = WASM_VECTOR_LEN;
|
|
369
|
+
wasm.incrementalxxh32_update(this.__wbg_ptr, ptr0, len0);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (Symbol.dispose) IncrementalXxh32.prototype[Symbol.dispose] = IncrementalXxh32.prototype.free;
|
|
373
|
+
|
|
374
|
+
export class IncrementalXxh64 {
|
|
375
|
+
__destroy_into_raw() {
|
|
376
|
+
const ptr = this.__wbg_ptr;
|
|
377
|
+
this.__wbg_ptr = 0;
|
|
378
|
+
IncrementalXxh64Finalization.unregister(this);
|
|
379
|
+
return ptr;
|
|
380
|
+
}
|
|
381
|
+
free() {
|
|
382
|
+
const ptr = this.__destroy_into_raw();
|
|
383
|
+
wasm.__wbg_incrementalxxh64_free(ptr, 0);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* @returns {string}
|
|
387
|
+
*/
|
|
388
|
+
finalize() {
|
|
389
|
+
let deferred1_0;
|
|
390
|
+
let deferred1_1;
|
|
391
|
+
try {
|
|
392
|
+
const ptr = this.__destroy_into_raw();
|
|
393
|
+
const ret = wasm.incrementalxxh64_finalize(ptr);
|
|
394
|
+
deferred1_0 = ret[0];
|
|
395
|
+
deferred1_1 = ret[1];
|
|
396
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
397
|
+
} finally {
|
|
398
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* @param {bigint} seed
|
|
403
|
+
*/
|
|
404
|
+
constructor(seed) {
|
|
405
|
+
const ret = wasm.incrementalxxh64_new(seed);
|
|
406
|
+
this.__wbg_ptr = ret >>> 0;
|
|
407
|
+
IncrementalXxh64Finalization.register(this, this.__wbg_ptr, this);
|
|
408
|
+
return this;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @param {Uint8Array} data
|
|
412
|
+
*/
|
|
413
|
+
update(data) {
|
|
414
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
415
|
+
const len0 = WASM_VECTOR_LEN;
|
|
416
|
+
wasm.incrementalxxh64_update(this.__wbg_ptr, ptr0, len0);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (Symbol.dispose) IncrementalXxh64.prototype[Symbol.dispose] = IncrementalXxh64.prototype.free;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Computes BLAKE3 hash. Fast and secure.
|
|
423
|
+
* @param {Uint8Array} data
|
|
424
|
+
* @returns {string}
|
|
425
|
+
*/
|
|
426
|
+
export function blake3_hex(data) {
|
|
427
|
+
let deferred2_0;
|
|
428
|
+
let deferred2_1;
|
|
429
|
+
try {
|
|
430
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
431
|
+
const len0 = WASM_VECTOR_LEN;
|
|
432
|
+
const ret = wasm.blake3_hex(ptr0, len0);
|
|
433
|
+
deferred2_0 = ret[0];
|
|
434
|
+
deferred2_1 = ret[1];
|
|
435
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
436
|
+
} finally {
|
|
437
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Computes keyed BLAKE3 hash. Key must be exactly 32 bytes.
|
|
443
|
+
* @param {Uint8Array} data
|
|
444
|
+
* @param {Uint8Array} key
|
|
445
|
+
* @returns {string}
|
|
446
|
+
*/
|
|
447
|
+
export function blake3_keyed_hex(data, key) {
|
|
448
|
+
let deferred4_0;
|
|
449
|
+
let deferred4_1;
|
|
450
|
+
try {
|
|
451
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
452
|
+
const len0 = WASM_VECTOR_LEN;
|
|
453
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
454
|
+
const len1 = WASM_VECTOR_LEN;
|
|
455
|
+
const ret = wasm.blake3_keyed_hex(ptr0, len0, ptr1, len1);
|
|
456
|
+
var ptr3 = ret[0];
|
|
457
|
+
var len3 = ret[1];
|
|
458
|
+
if (ret[3]) {
|
|
459
|
+
ptr3 = 0; len3 = 0;
|
|
460
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
461
|
+
}
|
|
462
|
+
deferred4_0 = ptr3;
|
|
463
|
+
deferred4_1 = len3;
|
|
464
|
+
return getStringFromWasm0(ptr3, len3);
|
|
465
|
+
} finally {
|
|
466
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Computes HMAC-SHA256 with a given key and data.
|
|
472
|
+
* @param {Uint8Array} key
|
|
473
|
+
* @param {Uint8Array} data
|
|
474
|
+
* @returns {string}
|
|
475
|
+
*/
|
|
476
|
+
export function hmac_sha256(key, data) {
|
|
477
|
+
let deferred3_0;
|
|
478
|
+
let deferred3_1;
|
|
479
|
+
try {
|
|
480
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
481
|
+
const len0 = WASM_VECTOR_LEN;
|
|
482
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
483
|
+
const len1 = WASM_VECTOR_LEN;
|
|
484
|
+
const ret = wasm.hmac_sha256(ptr0, len0, ptr1, len1);
|
|
485
|
+
deferred3_0 = ret[0];
|
|
486
|
+
deferred3_1 = ret[1];
|
|
487
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
488
|
+
} finally {
|
|
489
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Computes HMAC-SHA512 with a given key and data.
|
|
495
|
+
* @param {Uint8Array} key
|
|
496
|
+
* @param {Uint8Array} data
|
|
497
|
+
* @returns {string}
|
|
498
|
+
*/
|
|
499
|
+
export function hmac_sha512(key, data) {
|
|
500
|
+
let deferred3_0;
|
|
501
|
+
let deferred3_1;
|
|
502
|
+
try {
|
|
503
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
504
|
+
const len0 = WASM_VECTOR_LEN;
|
|
505
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
506
|
+
const len1 = WASM_VECTOR_LEN;
|
|
507
|
+
const ret = wasm.hmac_sha512(ptr0, len0, ptr1, len1);
|
|
508
|
+
deferred3_0 = ret[0];
|
|
509
|
+
deferred3_1 = ret[1];
|
|
510
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
511
|
+
} finally {
|
|
512
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Computes Keccak-224 hash.
|
|
518
|
+
* @param {Uint8Array} data
|
|
519
|
+
* @returns {string}
|
|
520
|
+
*/
|
|
521
|
+
export function keccak_224(data) {
|
|
522
|
+
let deferred2_0;
|
|
523
|
+
let deferred2_1;
|
|
524
|
+
try {
|
|
525
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
527
|
+
const ret = wasm.keccak_224(ptr0, len0);
|
|
528
|
+
deferred2_0 = ret[0];
|
|
529
|
+
deferred2_1 = ret[1];
|
|
530
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
531
|
+
} finally {
|
|
532
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Computes Keccak-256 hash.
|
|
538
|
+
* @param {Uint8Array} data
|
|
539
|
+
* @returns {string}
|
|
540
|
+
*/
|
|
541
|
+
export function keccak_256(data) {
|
|
542
|
+
let deferred2_0;
|
|
543
|
+
let deferred2_1;
|
|
544
|
+
try {
|
|
545
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
546
|
+
const len0 = WASM_VECTOR_LEN;
|
|
547
|
+
const ret = wasm.keccak_256(ptr0, len0);
|
|
548
|
+
deferred2_0 = ret[0];
|
|
549
|
+
deferred2_1 = ret[1];
|
|
550
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
551
|
+
} finally {
|
|
552
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Computes Keccak-384 hash.
|
|
558
|
+
* @param {Uint8Array} data
|
|
559
|
+
* @returns {string}
|
|
560
|
+
*/
|
|
561
|
+
export function keccak_384(data) {
|
|
562
|
+
let deferred2_0;
|
|
563
|
+
let deferred2_1;
|
|
564
|
+
try {
|
|
565
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
566
|
+
const len0 = WASM_VECTOR_LEN;
|
|
567
|
+
const ret = wasm.keccak_384(ptr0, len0);
|
|
568
|
+
deferred2_0 = ret[0];
|
|
569
|
+
deferred2_1 = ret[1];
|
|
570
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
571
|
+
} finally {
|
|
572
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Computes Keccak-512 hash.
|
|
578
|
+
* @param {Uint8Array} data
|
|
579
|
+
* @returns {string}
|
|
580
|
+
*/
|
|
581
|
+
export function keccak_512(data) {
|
|
582
|
+
let deferred2_0;
|
|
583
|
+
let deferred2_1;
|
|
584
|
+
try {
|
|
585
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
586
|
+
const len0 = WASM_VECTOR_LEN;
|
|
587
|
+
const ret = wasm.keccak_512(ptr0, len0);
|
|
588
|
+
deferred2_0 = ret[0];
|
|
589
|
+
deferred2_1 = ret[1];
|
|
590
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
591
|
+
} finally {
|
|
592
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Computes MD5 hash. Returns 32-character hex string.
|
|
598
|
+
* @param {Uint8Array} data
|
|
599
|
+
* @returns {string}
|
|
600
|
+
*/
|
|
601
|
+
export function md5_hex(data) {
|
|
602
|
+
let deferred2_0;
|
|
603
|
+
let deferred2_1;
|
|
604
|
+
try {
|
|
605
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
const ret = wasm.md5_hex(ptr0, len0);
|
|
608
|
+
deferred2_0 = ret[0];
|
|
609
|
+
deferred2_1 = ret[1];
|
|
610
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
611
|
+
} finally {
|
|
612
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export function run_app() {
|
|
617
|
+
wasm.run_app();
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Computes SHA-224 hash.
|
|
622
|
+
* @param {Uint8Array} data
|
|
623
|
+
* @returns {string}
|
|
624
|
+
*/
|
|
625
|
+
export function sha2_224(data) {
|
|
626
|
+
let deferred2_0;
|
|
627
|
+
let deferred2_1;
|
|
628
|
+
try {
|
|
629
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
630
|
+
const len0 = WASM_VECTOR_LEN;
|
|
631
|
+
const ret = wasm.sha2_224(ptr0, len0);
|
|
632
|
+
deferred2_0 = ret[0];
|
|
633
|
+
deferred2_1 = ret[1];
|
|
634
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
635
|
+
} finally {
|
|
636
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Computes SHA-256 hash.
|
|
642
|
+
* @param {Uint8Array} data
|
|
643
|
+
* @returns {string}
|
|
644
|
+
*/
|
|
645
|
+
export function sha2_256(data) {
|
|
646
|
+
let deferred2_0;
|
|
647
|
+
let deferred2_1;
|
|
648
|
+
try {
|
|
649
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
650
|
+
const len0 = WASM_VECTOR_LEN;
|
|
651
|
+
const ret = wasm.sha2_256(ptr0, len0);
|
|
652
|
+
deferred2_0 = ret[0];
|
|
653
|
+
deferred2_1 = ret[1];
|
|
654
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
655
|
+
} finally {
|
|
656
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Computes SHA-384 hash.
|
|
662
|
+
* @param {Uint8Array} data
|
|
663
|
+
* @returns {string}
|
|
664
|
+
*/
|
|
665
|
+
export function sha2_384(data) {
|
|
666
|
+
let deferred2_0;
|
|
667
|
+
let deferred2_1;
|
|
668
|
+
try {
|
|
669
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
670
|
+
const len0 = WASM_VECTOR_LEN;
|
|
671
|
+
const ret = wasm.sha2_384(ptr0, len0);
|
|
672
|
+
deferred2_0 = ret[0];
|
|
673
|
+
deferred2_1 = ret[1];
|
|
674
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
675
|
+
} finally {
|
|
676
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Computes SHA-512 hash.
|
|
682
|
+
* @param {Uint8Array} data
|
|
683
|
+
* @returns {string}
|
|
684
|
+
*/
|
|
685
|
+
export function sha2_512(data) {
|
|
686
|
+
let deferred2_0;
|
|
687
|
+
let deferred2_1;
|
|
688
|
+
try {
|
|
689
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
690
|
+
const len0 = WASM_VECTOR_LEN;
|
|
691
|
+
const ret = wasm.sha2_512(ptr0, len0);
|
|
692
|
+
deferred2_0 = ret[0];
|
|
693
|
+
deferred2_1 = ret[1];
|
|
694
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
695
|
+
} finally {
|
|
696
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Computes SHA-512/224 hash.
|
|
702
|
+
* @param {Uint8Array} data
|
|
703
|
+
* @returns {string}
|
|
704
|
+
*/
|
|
705
|
+
export function sha2_512_224(data) {
|
|
706
|
+
let deferred2_0;
|
|
707
|
+
let deferred2_1;
|
|
708
|
+
try {
|
|
709
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
710
|
+
const len0 = WASM_VECTOR_LEN;
|
|
711
|
+
const ret = wasm.sha2_512_224(ptr0, len0);
|
|
712
|
+
deferred2_0 = ret[0];
|
|
713
|
+
deferred2_1 = ret[1];
|
|
714
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
715
|
+
} finally {
|
|
716
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Computes SHA-512/256 hash.
|
|
722
|
+
* @param {Uint8Array} data
|
|
723
|
+
* @returns {string}
|
|
724
|
+
*/
|
|
725
|
+
export function sha2_512_256(data) {
|
|
726
|
+
let deferred2_0;
|
|
727
|
+
let deferred2_1;
|
|
728
|
+
try {
|
|
729
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
730
|
+
const len0 = WASM_VECTOR_LEN;
|
|
731
|
+
const ret = wasm.sha2_512_256(ptr0, len0);
|
|
732
|
+
deferred2_0 = ret[0];
|
|
733
|
+
deferred2_1 = ret[1];
|
|
734
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
735
|
+
} finally {
|
|
736
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Computes SHA3-224 hash.
|
|
742
|
+
* @param {Uint8Array} data
|
|
743
|
+
* @returns {string}
|
|
744
|
+
*/
|
|
745
|
+
export function sha3_224(data) {
|
|
746
|
+
let deferred2_0;
|
|
747
|
+
let deferred2_1;
|
|
748
|
+
try {
|
|
749
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
750
|
+
const len0 = WASM_VECTOR_LEN;
|
|
751
|
+
const ret = wasm.sha3_224(ptr0, len0);
|
|
752
|
+
deferred2_0 = ret[0];
|
|
753
|
+
deferred2_1 = ret[1];
|
|
754
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
755
|
+
} finally {
|
|
756
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Computes SHA3-256 hash.
|
|
762
|
+
* @param {Uint8Array} data
|
|
763
|
+
* @returns {string}
|
|
764
|
+
*/
|
|
765
|
+
export function sha3_256(data) {
|
|
766
|
+
let deferred2_0;
|
|
767
|
+
let deferred2_1;
|
|
768
|
+
try {
|
|
769
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
770
|
+
const len0 = WASM_VECTOR_LEN;
|
|
771
|
+
const ret = wasm.sha3_256(ptr0, len0);
|
|
772
|
+
deferred2_0 = ret[0];
|
|
773
|
+
deferred2_1 = ret[1];
|
|
774
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
775
|
+
} finally {
|
|
776
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Computes SHA3-384 hash.
|
|
782
|
+
* @param {Uint8Array} data
|
|
783
|
+
* @returns {string}
|
|
784
|
+
*/
|
|
785
|
+
export function sha3_384(data) {
|
|
786
|
+
let deferred2_0;
|
|
787
|
+
let deferred2_1;
|
|
788
|
+
try {
|
|
789
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
790
|
+
const len0 = WASM_VECTOR_LEN;
|
|
791
|
+
const ret = wasm.sha3_384(ptr0, len0);
|
|
792
|
+
deferred2_0 = ret[0];
|
|
793
|
+
deferred2_1 = ret[1];
|
|
794
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
795
|
+
} finally {
|
|
796
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Computes SHA3-512 hash.
|
|
802
|
+
* @param {Uint8Array} data
|
|
803
|
+
* @returns {string}
|
|
804
|
+
*/
|
|
805
|
+
export function sha3_512(data) {
|
|
806
|
+
let deferred2_0;
|
|
807
|
+
let deferred2_1;
|
|
808
|
+
try {
|
|
809
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
810
|
+
const len0 = WASM_VECTOR_LEN;
|
|
811
|
+
const ret = wasm.sha3_512(ptr0, len0);
|
|
812
|
+
deferred2_0 = ret[0];
|
|
813
|
+
deferred2_1 = ret[1];
|
|
814
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
815
|
+
} finally {
|
|
816
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* SHAKE-128: arbitrary-length output.
|
|
822
|
+
* @param {Uint8Array} data
|
|
823
|
+
* @param {number} output_len
|
|
824
|
+
* @returns {string}
|
|
825
|
+
*/
|
|
826
|
+
export function shake128(data, output_len) {
|
|
827
|
+
let deferred2_0;
|
|
828
|
+
let deferred2_1;
|
|
829
|
+
try {
|
|
830
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
831
|
+
const len0 = WASM_VECTOR_LEN;
|
|
832
|
+
const ret = wasm.shake128(ptr0, len0, output_len);
|
|
833
|
+
deferred2_0 = ret[0];
|
|
834
|
+
deferred2_1 = ret[1];
|
|
835
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
836
|
+
} finally {
|
|
837
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* SHAKE-256: arbitrary-length output.
|
|
843
|
+
* @param {Uint8Array} data
|
|
844
|
+
* @param {number} output_len
|
|
845
|
+
* @returns {string}
|
|
846
|
+
*/
|
|
847
|
+
export function shake256(data, output_len) {
|
|
848
|
+
let deferred2_0;
|
|
849
|
+
let deferred2_1;
|
|
850
|
+
try {
|
|
851
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
852
|
+
const len0 = WASM_VECTOR_LEN;
|
|
853
|
+
const ret = wasm.shake256(ptr0, len0, output_len);
|
|
854
|
+
deferred2_0 = ret[0];
|
|
855
|
+
deferred2_1 = ret[1];
|
|
856
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
857
|
+
} finally {
|
|
858
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Computes XXH32 hash with a 32-bit seed.
|
|
864
|
+
* @param {Uint8Array} data
|
|
865
|
+
* @param {number} seed
|
|
866
|
+
* @returns {string}
|
|
867
|
+
*/
|
|
868
|
+
export function xxh32_hex(data, seed) {
|
|
869
|
+
let deferred2_0;
|
|
870
|
+
let deferred2_1;
|
|
871
|
+
try {
|
|
872
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
873
|
+
const len0 = WASM_VECTOR_LEN;
|
|
874
|
+
const ret = wasm.xxh32_hex(ptr0, len0, seed);
|
|
875
|
+
deferred2_0 = ret[0];
|
|
876
|
+
deferred2_1 = ret[1];
|
|
877
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
878
|
+
} finally {
|
|
879
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Computes XXH3 128-bit hash.
|
|
885
|
+
* @param {Uint8Array} data
|
|
886
|
+
* @returns {string}
|
|
887
|
+
*/
|
|
888
|
+
export function xxh3_128_hex(data) {
|
|
889
|
+
let deferred2_0;
|
|
890
|
+
let deferred2_1;
|
|
891
|
+
try {
|
|
892
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
893
|
+
const len0 = WASM_VECTOR_LEN;
|
|
894
|
+
const ret = wasm.xxh3_128_hex(ptr0, len0);
|
|
895
|
+
deferred2_0 = ret[0];
|
|
896
|
+
deferred2_1 = ret[1];
|
|
897
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
898
|
+
} finally {
|
|
899
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Computes XXH3 128-bit hash with a 192-byte secret.
|
|
905
|
+
* @param {Uint8Array} data
|
|
906
|
+
* @param {Uint8Array} secret
|
|
907
|
+
* @returns {string}
|
|
908
|
+
*/
|
|
909
|
+
export function xxh3_128_secret_hex(data, secret) {
|
|
910
|
+
let deferred4_0;
|
|
911
|
+
let deferred4_1;
|
|
912
|
+
try {
|
|
913
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
914
|
+
const len0 = WASM_VECTOR_LEN;
|
|
915
|
+
const ptr1 = passArray8ToWasm0(secret, wasm.__wbindgen_malloc);
|
|
916
|
+
const len1 = WASM_VECTOR_LEN;
|
|
917
|
+
const ret = wasm.xxh3_128_secret_hex(ptr0, len0, ptr1, len1);
|
|
918
|
+
var ptr3 = ret[0];
|
|
919
|
+
var len3 = ret[1];
|
|
920
|
+
if (ret[3]) {
|
|
921
|
+
ptr3 = 0; len3 = 0;
|
|
922
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
923
|
+
}
|
|
924
|
+
deferred4_0 = ptr3;
|
|
925
|
+
deferred4_1 = len3;
|
|
926
|
+
return getStringFromWasm0(ptr3, len3);
|
|
927
|
+
} finally {
|
|
928
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Computes XXH3 128-bit hash with a 64-bit seed.
|
|
934
|
+
* @param {Uint8Array} data
|
|
935
|
+
* @param {bigint} seed
|
|
936
|
+
* @returns {string}
|
|
937
|
+
*/
|
|
938
|
+
export function xxh3_128_seed_hex(data, seed) {
|
|
939
|
+
let deferred2_0;
|
|
940
|
+
let deferred2_1;
|
|
941
|
+
try {
|
|
942
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
943
|
+
const len0 = WASM_VECTOR_LEN;
|
|
944
|
+
const ret = wasm.xxh3_128_seed_hex(ptr0, len0, seed);
|
|
945
|
+
deferred2_0 = ret[0];
|
|
946
|
+
deferred2_1 = ret[1];
|
|
947
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
948
|
+
} finally {
|
|
949
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Computes XXH3 64-bit hash. Fast and high quality.
|
|
955
|
+
* @param {Uint8Array} data
|
|
956
|
+
* @returns {string}
|
|
957
|
+
*/
|
|
958
|
+
export function xxh3_64_hex(data) {
|
|
959
|
+
let deferred2_0;
|
|
960
|
+
let deferred2_1;
|
|
961
|
+
try {
|
|
962
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
963
|
+
const len0 = WASM_VECTOR_LEN;
|
|
964
|
+
const ret = wasm.xxh3_64_hex(ptr0, len0);
|
|
965
|
+
deferred2_0 = ret[0];
|
|
966
|
+
deferred2_1 = ret[1];
|
|
967
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
968
|
+
} finally {
|
|
969
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Computes XXH3 64-bit hash with a 192-byte secret.
|
|
975
|
+
* @param {Uint8Array} data
|
|
976
|
+
* @param {Uint8Array} secret
|
|
977
|
+
* @returns {string}
|
|
978
|
+
*/
|
|
979
|
+
export function xxh3_64_secret_hex(data, secret) {
|
|
980
|
+
let deferred4_0;
|
|
981
|
+
let deferred4_1;
|
|
982
|
+
try {
|
|
983
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
984
|
+
const len0 = WASM_VECTOR_LEN;
|
|
985
|
+
const ptr1 = passArray8ToWasm0(secret, wasm.__wbindgen_malloc);
|
|
986
|
+
const len1 = WASM_VECTOR_LEN;
|
|
987
|
+
const ret = wasm.xxh3_64_secret_hex(ptr0, len0, ptr1, len1);
|
|
988
|
+
var ptr3 = ret[0];
|
|
989
|
+
var len3 = ret[1];
|
|
990
|
+
if (ret[3]) {
|
|
991
|
+
ptr3 = 0; len3 = 0;
|
|
992
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
993
|
+
}
|
|
994
|
+
deferred4_0 = ptr3;
|
|
995
|
+
deferred4_1 = len3;
|
|
996
|
+
return getStringFromWasm0(ptr3, len3);
|
|
997
|
+
} finally {
|
|
998
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Computes XXH3 64-bit hash with a 64-bit seed.
|
|
1004
|
+
* @param {Uint8Array} data
|
|
1005
|
+
* @param {bigint} seed
|
|
1006
|
+
* @returns {string}
|
|
1007
|
+
*/
|
|
1008
|
+
export function xxh3_64_seed_hex(data, seed) {
|
|
1009
|
+
let deferred2_0;
|
|
1010
|
+
let deferred2_1;
|
|
1011
|
+
try {
|
|
1012
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1013
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1014
|
+
const ret = wasm.xxh3_64_seed_hex(ptr0, len0, seed);
|
|
1015
|
+
deferred2_0 = ret[0];
|
|
1016
|
+
deferred2_1 = ret[1];
|
|
1017
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1018
|
+
} finally {
|
|
1019
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Computes XXH64 hash with a 64-bit seed.
|
|
1025
|
+
* @param {Uint8Array} data
|
|
1026
|
+
* @param {bigint} seed
|
|
1027
|
+
* @returns {string}
|
|
1028
|
+
*/
|
|
1029
|
+
export function xxh64_hex(data, seed) {
|
|
1030
|
+
let deferred2_0;
|
|
1031
|
+
let deferred2_1;
|
|
1032
|
+
try {
|
|
1033
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1034
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1035
|
+
const ret = wasm.xxh64_hex(ptr0, len0, seed);
|
|
1036
|
+
deferred2_0 = ret[0];
|
|
1037
|
+
deferred2_1 = ret[1];
|
|
1038
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1039
|
+
} finally {
|
|
1040
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
function __wbg_get_imports() {
|
|
1045
|
+
const import0 = {
|
|
1046
|
+
__proto__: null,
|
|
1047
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
1048
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1049
|
+
},
|
|
1050
|
+
__wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
|
|
1051
|
+
let deferred0_0;
|
|
1052
|
+
let deferred0_1;
|
|
1053
|
+
try {
|
|
1054
|
+
deferred0_0 = arg0;
|
|
1055
|
+
deferred0_1 = arg1;
|
|
1056
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1057
|
+
} finally {
|
|
1058
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
__wbg_new_8a6f238a6ece86ea: function() {
|
|
1062
|
+
const ret = new Error();
|
|
1063
|
+
return ret;
|
|
1064
|
+
},
|
|
1065
|
+
__wbg_stack_0ed75d68575b0f3c: function(arg0, arg1) {
|
|
1066
|
+
const ret = arg1.stack;
|
|
1067
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1068
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1069
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1070
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1071
|
+
},
|
|
1072
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1073
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1074
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1075
|
+
return ret;
|
|
1076
|
+
},
|
|
1077
|
+
__wbindgen_init_externref_table: function() {
|
|
1078
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1079
|
+
const offset = table.grow(4);
|
|
1080
|
+
table.set(0, undefined);
|
|
1081
|
+
table.set(offset + 0, undefined);
|
|
1082
|
+
table.set(offset + 1, null);
|
|
1083
|
+
table.set(offset + 2, true);
|
|
1084
|
+
table.set(offset + 3, false);
|
|
1085
|
+
},
|
|
1086
|
+
};
|
|
1087
|
+
return {
|
|
1088
|
+
__proto__: null,
|
|
1089
|
+
"./rasmx_hash_bg.js": import0,
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
const IncrementalBlake3Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1094
|
+
? { register: () => {}, unregister: () => {} }
|
|
1095
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalblake3_free(ptr >>> 0, 1));
|
|
1096
|
+
const IncrementalKeccak256Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1097
|
+
? { register: () => {}, unregister: () => {} }
|
|
1098
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalkeccak256_free(ptr >>> 0, 1));
|
|
1099
|
+
const IncrementalMd5Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1100
|
+
? { register: () => {}, unregister: () => {} }
|
|
1101
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalmd5_free(ptr >>> 0, 1));
|
|
1102
|
+
const IncrementalSha256Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1103
|
+
? { register: () => {}, unregister: () => {} }
|
|
1104
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalsha256_free(ptr >>> 0, 1));
|
|
1105
|
+
const IncrementalSha3_256Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1106
|
+
? { register: () => {}, unregister: () => {} }
|
|
1107
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalsha3_256_free(ptr >>> 0, 1));
|
|
1108
|
+
const IncrementalSha512Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1109
|
+
? { register: () => {}, unregister: () => {} }
|
|
1110
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalsha512_free(ptr >>> 0, 1));
|
|
1111
|
+
const IncrementalXxh3Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1112
|
+
? { register: () => {}, unregister: () => {} }
|
|
1113
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalxxh3_free(ptr >>> 0, 1));
|
|
1114
|
+
const IncrementalXxh32Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1115
|
+
? { register: () => {}, unregister: () => {} }
|
|
1116
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalxxh32_free(ptr >>> 0, 1));
|
|
1117
|
+
const IncrementalXxh64Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
1118
|
+
? { register: () => {}, unregister: () => {} }
|
|
1119
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrementalxxh64_free(ptr >>> 0, 1));
|
|
1120
|
+
|
|
1121
|
+
let cachedDataViewMemory0 = null;
|
|
1122
|
+
function getDataViewMemory0() {
|
|
1123
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1124
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1125
|
+
}
|
|
1126
|
+
return cachedDataViewMemory0;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
function getStringFromWasm0(ptr, len) {
|
|
1130
|
+
ptr = ptr >>> 0;
|
|
1131
|
+
return decodeText(ptr, len);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1135
|
+
function getUint8ArrayMemory0() {
|
|
1136
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1137
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1138
|
+
}
|
|
1139
|
+
return cachedUint8ArrayMemory0;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1143
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1144
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1145
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1146
|
+
return ptr;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1150
|
+
if (realloc === undefined) {
|
|
1151
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1152
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1153
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1154
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1155
|
+
return ptr;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
let len = arg.length;
|
|
1159
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1160
|
+
|
|
1161
|
+
const mem = getUint8ArrayMemory0();
|
|
1162
|
+
|
|
1163
|
+
let offset = 0;
|
|
1164
|
+
|
|
1165
|
+
for (; offset < len; offset++) {
|
|
1166
|
+
const code = arg.charCodeAt(offset);
|
|
1167
|
+
if (code > 0x7F) break;
|
|
1168
|
+
mem[ptr + offset] = code;
|
|
1169
|
+
}
|
|
1170
|
+
if (offset !== len) {
|
|
1171
|
+
if (offset !== 0) {
|
|
1172
|
+
arg = arg.slice(offset);
|
|
1173
|
+
}
|
|
1174
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1175
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1176
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1177
|
+
|
|
1178
|
+
offset += ret.written;
|
|
1179
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
WASM_VECTOR_LEN = offset;
|
|
1183
|
+
return ptr;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
function takeFromExternrefTable0(idx) {
|
|
1187
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1188
|
+
wasm.__externref_table_dealloc(idx);
|
|
1189
|
+
return value;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1193
|
+
cachedTextDecoder.decode();
|
|
1194
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1195
|
+
let numBytesDecoded = 0;
|
|
1196
|
+
function decodeText(ptr, len) {
|
|
1197
|
+
numBytesDecoded += len;
|
|
1198
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1199
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1200
|
+
cachedTextDecoder.decode();
|
|
1201
|
+
numBytesDecoded = len;
|
|
1202
|
+
}
|
|
1203
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1207
|
+
|
|
1208
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1209
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1210
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1211
|
+
view.set(buf);
|
|
1212
|
+
return {
|
|
1213
|
+
read: arg.length,
|
|
1214
|
+
written: buf.length
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
let WASM_VECTOR_LEN = 0;
|
|
1220
|
+
|
|
1221
|
+
let wasmModule, wasm;
|
|
1222
|
+
function __wbg_finalize_init(instance, module) {
|
|
1223
|
+
wasm = instance.exports;
|
|
1224
|
+
wasmModule = module;
|
|
1225
|
+
cachedDataViewMemory0 = null;
|
|
1226
|
+
cachedUint8ArrayMemory0 = null;
|
|
1227
|
+
wasm.__wbindgen_start();
|
|
1228
|
+
return wasm;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
async function __wbg_load(module, imports) {
|
|
1232
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1233
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1234
|
+
try {
|
|
1235
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1236
|
+
} catch (e) {
|
|
1237
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1238
|
+
|
|
1239
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1240
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1241
|
+
|
|
1242
|
+
} else { throw e; }
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
const bytes = await module.arrayBuffer();
|
|
1247
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1248
|
+
} else {
|
|
1249
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1250
|
+
|
|
1251
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1252
|
+
return { instance, module };
|
|
1253
|
+
} else {
|
|
1254
|
+
return instance;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
function expectedResponseType(type) {
|
|
1259
|
+
switch (type) {
|
|
1260
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1261
|
+
}
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function initSync(module) {
|
|
1267
|
+
if (wasm !== undefined) return wasm;
|
|
1268
|
+
|
|
1269
|
+
|
|
1270
|
+
if (module !== undefined) {
|
|
1271
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1272
|
+
({module} = module)
|
|
1273
|
+
} else {
|
|
1274
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
const imports = __wbg_get_imports();
|
|
1279
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1280
|
+
module = new WebAssembly.Module(module);
|
|
1281
|
+
}
|
|
1282
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1283
|
+
return __wbg_finalize_init(instance, module);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
async function __wbg_init(module_or_path) {
|
|
1287
|
+
if (wasm !== undefined) return wasm;
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
if (module_or_path !== undefined) {
|
|
1291
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1292
|
+
({module_or_path} = module_or_path)
|
|
1293
|
+
} else {
|
|
1294
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
if (module_or_path === undefined) {
|
|
1299
|
+
module_or_path = new URL('rasmx_hash_bg.wasm', import.meta.url);
|
|
1300
|
+
}
|
|
1301
|
+
const imports = __wbg_get_imports();
|
|
1302
|
+
|
|
1303
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1304
|
+
module_or_path = fetch(module_or_path);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1308
|
+
|
|
1309
|
+
return __wbg_finalize_init(instance, module);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
export { initSync, __wbg_init as default };
|