@iscc/wasm 0.0.2 → 0.0.3
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/iscc_wasm.d.ts +91 -0
- package/iscc_wasm.js +249 -0
- package/iscc_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/iscc_wasm.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ export class DataHasher {
|
|
|
28
28
|
update(data: Uint8Array): void;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Default read buffer size for streaming I/O (4 MB).
|
|
33
|
+
*/
|
|
34
|
+
export function IO_READ_SIZE(): number;
|
|
35
|
+
|
|
31
36
|
/**
|
|
32
37
|
* Streaming Instance-Code generator.
|
|
33
38
|
*
|
|
@@ -55,6 +60,50 @@ export class InstanceHasher {
|
|
|
55
60
|
update(data: Uint8Array): void;
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Result of decoding an ISCC unit string.
|
|
65
|
+
*/
|
|
66
|
+
export class IsccDecodeResult {
|
|
67
|
+
private constructor();
|
|
68
|
+
free(): void;
|
|
69
|
+
[Symbol.dispose](): void;
|
|
70
|
+
/**
|
|
71
|
+
* Raw digest bytes truncated to the encoded bit-length.
|
|
72
|
+
*/
|
|
73
|
+
digest: Uint8Array;
|
|
74
|
+
/**
|
|
75
|
+
* Length index from the header.
|
|
76
|
+
*/
|
|
77
|
+
length: number;
|
|
78
|
+
/**
|
|
79
|
+
* MainType enum value (0–7).
|
|
80
|
+
*/
|
|
81
|
+
maintype: number;
|
|
82
|
+
/**
|
|
83
|
+
* SubType enum value (0–7).
|
|
84
|
+
*/
|
|
85
|
+
subtype: number;
|
|
86
|
+
/**
|
|
87
|
+
* Version enum value.
|
|
88
|
+
*/
|
|
89
|
+
version: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Maximum byte length for the description field after trimming.
|
|
94
|
+
*/
|
|
95
|
+
export function META_TRIM_DESCRIPTION(): number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Maximum byte length for the name field after trimming.
|
|
99
|
+
*/
|
|
100
|
+
export function META_TRIM_NAME(): number;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Sliding window width for text n-gram generation.
|
|
104
|
+
*/
|
|
105
|
+
export function TEXT_NGRAM_SIZE(): number;
|
|
106
|
+
|
|
58
107
|
/**
|
|
59
108
|
* Split data into content-defined chunks using gear rolling hash.
|
|
60
109
|
*
|
|
@@ -88,6 +137,14 @@ export function alg_simhash(hash_digests: any): Uint8Array;
|
|
|
88
137
|
*/
|
|
89
138
|
export function encode_base64(data: Uint8Array): string;
|
|
90
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Encode raw ISCC header components and digest into a base32 ISCC unit string.
|
|
142
|
+
*
|
|
143
|
+
* Takes integer type identifiers and a raw digest, returns a base32-encoded
|
|
144
|
+
* ISCC unit string (without "ISCC:" prefix).
|
|
145
|
+
*/
|
|
146
|
+
export function encode_component(mtype: number, stype: number, version: number, bit_length: number, digest: Uint8Array): string;
|
|
147
|
+
|
|
91
148
|
/**
|
|
92
149
|
* Generate an Audio-Code from a Chromaprint feature vector.
|
|
93
150
|
*
|
|
@@ -160,6 +217,14 @@ export function gen_text_code_v0(text: string, bits?: number | null): string;
|
|
|
160
217
|
*/
|
|
161
218
|
export function gen_video_code_v0(frame_sigs: any, bits?: number | null): string;
|
|
162
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Decode an ISCC unit string into header components and raw digest.
|
|
222
|
+
*
|
|
223
|
+
* Returns an object with `maintype`, `subtype`, `version`, `length`, and
|
|
224
|
+
* `digest` fields. Strips an optional "ISCC:" prefix before decoding.
|
|
225
|
+
*/
|
|
226
|
+
export function iscc_decode(iscc: string): IsccDecodeResult;
|
|
227
|
+
|
|
163
228
|
/**
|
|
164
229
|
* Decompose a composite ISCC-CODE into individual ISCC-UNITs.
|
|
165
230
|
*
|
|
@@ -169,6 +234,14 @@ export function gen_video_code_v0(frame_sigs: any, bits?: number | null): string
|
|
|
169
234
|
*/
|
|
170
235
|
export function iscc_decompose(iscc_code: string): string[];
|
|
171
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Convert a JSON string into a `data:` URL with JCS canonicalization.
|
|
239
|
+
*
|
|
240
|
+
* Uses `application/ld+json` media type when the JSON contains an `@context`
|
|
241
|
+
* key, otherwise `application/json`.
|
|
242
|
+
*/
|
|
243
|
+
export function json_to_data_url(json: string): string;
|
|
244
|
+
|
|
172
245
|
/**
|
|
173
246
|
* Generate sliding window n-grams from a string.
|
|
174
247
|
*
|
|
@@ -222,8 +295,23 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
222
295
|
|
|
223
296
|
export interface InitOutput {
|
|
224
297
|
readonly memory: WebAssembly.Memory;
|
|
298
|
+
readonly IO_READ_SIZE: () => number;
|
|
299
|
+
readonly META_TRIM_DESCRIPTION: () => number;
|
|
300
|
+
readonly META_TRIM_NAME: () => number;
|
|
301
|
+
readonly TEXT_NGRAM_SIZE: () => number;
|
|
225
302
|
readonly __wbg_datahasher_free: (a: number, b: number) => void;
|
|
303
|
+
readonly __wbg_get_isccdecoderesult_digest: (a: number, b: number) => void;
|
|
304
|
+
readonly __wbg_get_isccdecoderesult_length: (a: number) => number;
|
|
305
|
+
readonly __wbg_get_isccdecoderesult_maintype: (a: number) => number;
|
|
306
|
+
readonly __wbg_get_isccdecoderesult_subtype: (a: number) => number;
|
|
307
|
+
readonly __wbg_get_isccdecoderesult_version: (a: number) => number;
|
|
226
308
|
readonly __wbg_instancehasher_free: (a: number, b: number) => void;
|
|
309
|
+
readonly __wbg_isccdecoderesult_free: (a: number, b: number) => void;
|
|
310
|
+
readonly __wbg_set_isccdecoderesult_digest: (a: number, b: number, c: number) => void;
|
|
311
|
+
readonly __wbg_set_isccdecoderesult_length: (a: number, b: number) => void;
|
|
312
|
+
readonly __wbg_set_isccdecoderesult_maintype: (a: number, b: number) => void;
|
|
313
|
+
readonly __wbg_set_isccdecoderesult_subtype: (a: number, b: number) => void;
|
|
314
|
+
readonly __wbg_set_isccdecoderesult_version: (a: number, b: number) => void;
|
|
227
315
|
readonly alg_cdc_chunks: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
228
316
|
readonly alg_minhash_256: (a: number, b: number, c: number) => void;
|
|
229
317
|
readonly alg_simhash: (a: number, b: number) => void;
|
|
@@ -231,6 +319,7 @@ export interface InitOutput {
|
|
|
231
319
|
readonly datahasher_new: () => number;
|
|
232
320
|
readonly datahasher_update: (a: number, b: number, c: number, d: number) => void;
|
|
233
321
|
readonly encode_base64: (a: number, b: number, c: number) => void;
|
|
322
|
+
readonly encode_component: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
234
323
|
readonly gen_audio_code_v0: (a: number, b: number, c: number, d: number) => void;
|
|
235
324
|
readonly gen_data_code_v0: (a: number, b: number, c: number, d: number) => void;
|
|
236
325
|
readonly gen_image_code_v0: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -243,7 +332,9 @@ export interface InitOutput {
|
|
|
243
332
|
readonly instancehasher_finalize: (a: number, b: number, c: number) => void;
|
|
244
333
|
readonly instancehasher_new: () => number;
|
|
245
334
|
readonly instancehasher_update: (a: number, b: number, c: number, d: number) => void;
|
|
335
|
+
readonly iscc_decode: (a: number, b: number, c: number) => void;
|
|
246
336
|
readonly iscc_decompose: (a: number, b: number, c: number) => void;
|
|
337
|
+
readonly json_to_data_url: (a: number, b: number, c: number) => void;
|
|
247
338
|
readonly sliding_window: (a: number, b: number, c: number, d: number) => void;
|
|
248
339
|
readonly soft_hash_video_v0: (a: number, b: number, c: number) => void;
|
|
249
340
|
readonly text_clean: (a: number, b: number, c: number) => void;
|
package/iscc_wasm.js
CHANGED
|
@@ -81,6 +81,15 @@ export class DataHasher {
|
|
|
81
81
|
}
|
|
82
82
|
if (Symbol.dispose) DataHasher.prototype[Symbol.dispose] = DataHasher.prototype.free;
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Default read buffer size for streaming I/O (4 MB).
|
|
86
|
+
* @returns {number}
|
|
87
|
+
*/
|
|
88
|
+
export function IO_READ_SIZE() {
|
|
89
|
+
const ret = wasm.IO_READ_SIZE();
|
|
90
|
+
return ret >>> 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
84
93
|
/**
|
|
85
94
|
* Streaming Instance-Code generator.
|
|
86
95
|
*
|
|
@@ -162,6 +171,143 @@ export class InstanceHasher {
|
|
|
162
171
|
}
|
|
163
172
|
if (Symbol.dispose) InstanceHasher.prototype[Symbol.dispose] = InstanceHasher.prototype.free;
|
|
164
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Result of decoding an ISCC unit string.
|
|
176
|
+
*/
|
|
177
|
+
export class IsccDecodeResult {
|
|
178
|
+
static __wrap(ptr) {
|
|
179
|
+
ptr = ptr >>> 0;
|
|
180
|
+
const obj = Object.create(IsccDecodeResult.prototype);
|
|
181
|
+
obj.__wbg_ptr = ptr;
|
|
182
|
+
IsccDecodeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
183
|
+
return obj;
|
|
184
|
+
}
|
|
185
|
+
__destroy_into_raw() {
|
|
186
|
+
const ptr = this.__wbg_ptr;
|
|
187
|
+
this.__wbg_ptr = 0;
|
|
188
|
+
IsccDecodeResultFinalization.unregister(this);
|
|
189
|
+
return ptr;
|
|
190
|
+
}
|
|
191
|
+
free() {
|
|
192
|
+
const ptr = this.__destroy_into_raw();
|
|
193
|
+
wasm.__wbg_isccdecoderesult_free(ptr, 0);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Raw digest bytes truncated to the encoded bit-length.
|
|
197
|
+
* @returns {Uint8Array}
|
|
198
|
+
*/
|
|
199
|
+
get digest() {
|
|
200
|
+
try {
|
|
201
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
202
|
+
wasm.__wbg_get_isccdecoderesult_digest(retptr, this.__wbg_ptr);
|
|
203
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
204
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
205
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
206
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
207
|
+
return v1;
|
|
208
|
+
} finally {
|
|
209
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Length index from the header.
|
|
214
|
+
* @returns {number}
|
|
215
|
+
*/
|
|
216
|
+
get length() {
|
|
217
|
+
const ret = wasm.__wbg_get_isccdecoderesult_length(this.__wbg_ptr);
|
|
218
|
+
return ret;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* MainType enum value (0–7).
|
|
222
|
+
* @returns {number}
|
|
223
|
+
*/
|
|
224
|
+
get maintype() {
|
|
225
|
+
const ret = wasm.__wbg_get_isccdecoderesult_maintype(this.__wbg_ptr);
|
|
226
|
+
return ret;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* SubType enum value (0–7).
|
|
230
|
+
* @returns {number}
|
|
231
|
+
*/
|
|
232
|
+
get subtype() {
|
|
233
|
+
const ret = wasm.__wbg_get_isccdecoderesult_subtype(this.__wbg_ptr);
|
|
234
|
+
return ret;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Version enum value.
|
|
238
|
+
* @returns {number}
|
|
239
|
+
*/
|
|
240
|
+
get version() {
|
|
241
|
+
const ret = wasm.__wbg_get_isccdecoderesult_version(this.__wbg_ptr);
|
|
242
|
+
return ret;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Raw digest bytes truncated to the encoded bit-length.
|
|
246
|
+
* @param {Uint8Array} arg0
|
|
247
|
+
*/
|
|
248
|
+
set digest(arg0) {
|
|
249
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_export);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
wasm.__wbg_set_isccdecoderesult_digest(this.__wbg_ptr, ptr0, len0);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Length index from the header.
|
|
255
|
+
* @param {number} arg0
|
|
256
|
+
*/
|
|
257
|
+
set length(arg0) {
|
|
258
|
+
wasm.__wbg_set_isccdecoderesult_length(this.__wbg_ptr, arg0);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* MainType enum value (0–7).
|
|
262
|
+
* @param {number} arg0
|
|
263
|
+
*/
|
|
264
|
+
set maintype(arg0) {
|
|
265
|
+
wasm.__wbg_set_isccdecoderesult_maintype(this.__wbg_ptr, arg0);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* SubType enum value (0–7).
|
|
269
|
+
* @param {number} arg0
|
|
270
|
+
*/
|
|
271
|
+
set subtype(arg0) {
|
|
272
|
+
wasm.__wbg_set_isccdecoderesult_subtype(this.__wbg_ptr, arg0);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Version enum value.
|
|
276
|
+
* @param {number} arg0
|
|
277
|
+
*/
|
|
278
|
+
set version(arg0) {
|
|
279
|
+
wasm.__wbg_set_isccdecoderesult_version(this.__wbg_ptr, arg0);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (Symbol.dispose) IsccDecodeResult.prototype[Symbol.dispose] = IsccDecodeResult.prototype.free;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Maximum byte length for the description field after trimming.
|
|
286
|
+
* @returns {number}
|
|
287
|
+
*/
|
|
288
|
+
export function META_TRIM_DESCRIPTION() {
|
|
289
|
+
const ret = wasm.META_TRIM_DESCRIPTION();
|
|
290
|
+
return ret >>> 0;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Maximum byte length for the name field after trimming.
|
|
295
|
+
* @returns {number}
|
|
296
|
+
*/
|
|
297
|
+
export function META_TRIM_NAME() {
|
|
298
|
+
const ret = wasm.META_TRIM_NAME();
|
|
299
|
+
return ret >>> 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Sliding window width for text n-gram generation.
|
|
304
|
+
* @returns {number}
|
|
305
|
+
*/
|
|
306
|
+
export function TEXT_NGRAM_SIZE() {
|
|
307
|
+
const ret = wasm.TEXT_NGRAM_SIZE();
|
|
308
|
+
return ret >>> 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
165
311
|
/**
|
|
166
312
|
* Split data into content-defined chunks using gear rolling hash.
|
|
167
313
|
*
|
|
@@ -269,6 +415,45 @@ export function encode_base64(data) {
|
|
|
269
415
|
}
|
|
270
416
|
}
|
|
271
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Encode raw ISCC header components and digest into a base32 ISCC unit string.
|
|
420
|
+
*
|
|
421
|
+
* Takes integer type identifiers and a raw digest, returns a base32-encoded
|
|
422
|
+
* ISCC unit string (without "ISCC:" prefix).
|
|
423
|
+
* @param {number} mtype
|
|
424
|
+
* @param {number} stype
|
|
425
|
+
* @param {number} version
|
|
426
|
+
* @param {number} bit_length
|
|
427
|
+
* @param {Uint8Array} digest
|
|
428
|
+
* @returns {string}
|
|
429
|
+
*/
|
|
430
|
+
export function encode_component(mtype, stype, version, bit_length, digest) {
|
|
431
|
+
let deferred3_0;
|
|
432
|
+
let deferred3_1;
|
|
433
|
+
try {
|
|
434
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
435
|
+
const ptr0 = passArray8ToWasm0(digest, wasm.__wbindgen_export);
|
|
436
|
+
const len0 = WASM_VECTOR_LEN;
|
|
437
|
+
wasm.encode_component(retptr, mtype, stype, version, bit_length, ptr0, len0);
|
|
438
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
439
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
440
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
441
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
442
|
+
var ptr2 = r0;
|
|
443
|
+
var len2 = r1;
|
|
444
|
+
if (r3) {
|
|
445
|
+
ptr2 = 0; len2 = 0;
|
|
446
|
+
throw takeObject(r2);
|
|
447
|
+
}
|
|
448
|
+
deferred3_0 = ptr2;
|
|
449
|
+
deferred3_1 = len2;
|
|
450
|
+
return getStringFromWasm0(ptr2, len2);
|
|
451
|
+
} finally {
|
|
452
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
453
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
272
457
|
/**
|
|
273
458
|
* Generate an Audio-Code from a Chromaprint feature vector.
|
|
274
459
|
*
|
|
@@ -593,6 +778,32 @@ export function gen_video_code_v0(frame_sigs, bits) {
|
|
|
593
778
|
}
|
|
594
779
|
}
|
|
595
780
|
|
|
781
|
+
/**
|
|
782
|
+
* Decode an ISCC unit string into header components and raw digest.
|
|
783
|
+
*
|
|
784
|
+
* Returns an object with `maintype`, `subtype`, `version`, `length`, and
|
|
785
|
+
* `digest` fields. Strips an optional "ISCC:" prefix before decoding.
|
|
786
|
+
* @param {string} iscc
|
|
787
|
+
* @returns {IsccDecodeResult}
|
|
788
|
+
*/
|
|
789
|
+
export function iscc_decode(iscc) {
|
|
790
|
+
try {
|
|
791
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
792
|
+
const ptr0 = passStringToWasm0(iscc, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
793
|
+
const len0 = WASM_VECTOR_LEN;
|
|
794
|
+
wasm.iscc_decode(retptr, ptr0, len0);
|
|
795
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
796
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
797
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
798
|
+
if (r2) {
|
|
799
|
+
throw takeObject(r1);
|
|
800
|
+
}
|
|
801
|
+
return IsccDecodeResult.__wrap(r0);
|
|
802
|
+
} finally {
|
|
803
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
596
807
|
/**
|
|
597
808
|
* Decompose a composite ISCC-CODE into individual ISCC-UNITs.
|
|
598
809
|
*
|
|
@@ -623,6 +834,41 @@ export function iscc_decompose(iscc_code) {
|
|
|
623
834
|
}
|
|
624
835
|
}
|
|
625
836
|
|
|
837
|
+
/**
|
|
838
|
+
* Convert a JSON string into a `data:` URL with JCS canonicalization.
|
|
839
|
+
*
|
|
840
|
+
* Uses `application/ld+json` media type when the JSON contains an `@context`
|
|
841
|
+
* key, otherwise `application/json`.
|
|
842
|
+
* @param {string} json
|
|
843
|
+
* @returns {string}
|
|
844
|
+
*/
|
|
845
|
+
export function json_to_data_url(json) {
|
|
846
|
+
let deferred3_0;
|
|
847
|
+
let deferred3_1;
|
|
848
|
+
try {
|
|
849
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
850
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
851
|
+
const len0 = WASM_VECTOR_LEN;
|
|
852
|
+
wasm.json_to_data_url(retptr, ptr0, len0);
|
|
853
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
854
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
855
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
856
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
857
|
+
var ptr2 = r0;
|
|
858
|
+
var len2 = r1;
|
|
859
|
+
if (r3) {
|
|
860
|
+
ptr2 = 0; len2 = 0;
|
|
861
|
+
throw takeObject(r2);
|
|
862
|
+
}
|
|
863
|
+
deferred3_0 = ptr2;
|
|
864
|
+
deferred3_1 = len2;
|
|
865
|
+
return getStringFromWasm0(ptr2, len2);
|
|
866
|
+
} finally {
|
|
867
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
868
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
626
872
|
/**
|
|
627
873
|
* Generate sliding window n-grams from a string.
|
|
628
874
|
*
|
|
@@ -959,6 +1205,9 @@ const DataHasherFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
959
1205
|
const InstanceHasherFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
960
1206
|
? { register: () => {}, unregister: () => {} }
|
|
961
1207
|
: new FinalizationRegistry(ptr => wasm.__wbg_instancehasher_free(ptr >>> 0, 1));
|
|
1208
|
+
const IsccDecodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1209
|
+
? { register: () => {}, unregister: () => {} }
|
|
1210
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_isccdecoderesult_free(ptr >>> 0, 1));
|
|
962
1211
|
|
|
963
1212
|
function addHeapObject(obj) {
|
|
964
1213
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
package/iscc_wasm_bg.wasm
CHANGED
|
Binary file
|