@iscc/wasm 0.1.0 → 0.2.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/iscc_wasm.d.ts +8 -0
- package/iscc_wasm.js +11 -0
- package/iscc_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/iscc_wasm.d.ts
CHANGED
|
@@ -164,6 +164,13 @@ export function alg_minhash_256(features: Uint32Array): Uint8Array;
|
|
|
164
164
|
*/
|
|
165
165
|
export function alg_simhash(hash_digests: any): Uint8Array;
|
|
166
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Run all conformance tests against vendored test vectors.
|
|
169
|
+
*
|
|
170
|
+
* Returns `true` if all tests pass, `false` if any fail.
|
|
171
|
+
*/
|
|
172
|
+
export function conformance_selftest(): boolean;
|
|
173
|
+
|
|
167
174
|
/**
|
|
168
175
|
* Encode bytes as base64url (RFC 4648 §5, no padding).
|
|
169
176
|
*
|
|
@@ -371,6 +378,7 @@ export interface InitOutput {
|
|
|
371
378
|
readonly alg_cdc_chunks: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
372
379
|
readonly alg_minhash_256: (a: number, b: number, c: number) => void;
|
|
373
380
|
readonly alg_simhash: (a: number, b: number) => void;
|
|
381
|
+
readonly conformance_selftest: () => number;
|
|
374
382
|
readonly datahasher_finalize: (a: number, b: number, c: number) => void;
|
|
375
383
|
readonly datahasher_new: () => number;
|
|
376
384
|
readonly datahasher_update: (a: number, b: number, c: number, d: number) => void;
|
package/iscc_wasm.js
CHANGED
|
@@ -524,6 +524,17 @@ export function alg_simhash(hash_digests) {
|
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
+
/**
|
|
528
|
+
* Run all conformance tests against vendored test vectors.
|
|
529
|
+
*
|
|
530
|
+
* Returns `true` if all tests pass, `false` if any fail.
|
|
531
|
+
* @returns {boolean}
|
|
532
|
+
*/
|
|
533
|
+
export function conformance_selftest() {
|
|
534
|
+
const ret = wasm.conformance_selftest();
|
|
535
|
+
return ret !== 0;
|
|
536
|
+
}
|
|
537
|
+
|
|
527
538
|
/**
|
|
528
539
|
* Encode bytes as base64url (RFC 4648 §5, no padding).
|
|
529
540
|
*
|
package/iscc_wasm_bg.wasm
CHANGED
|
Binary file
|