@privateid/charlie-web-sdk-alpha
Advanced tools
Comparing version 0.0.1-alpha to 0.0.2-alpha
@@ -109,2 +109,3 @@ export type Base64 = ArrayBuffer | string; | ||
}>; | ||
checkIfModelsLoadedultraScanBackDocument: (isEnroll: boolean) => Promise<number>; | ||
}; | ||
@@ -111,0 +112,0 @@ export interface verificationSessionPayload { |
@@ -5,3 +5,3 @@ { | ||
"description": "CryptoNets WebAssembly SDK", | ||
"version": "0.0.1-alpha", | ||
"version": "0.0.2-alpha", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "Face recognition", |
@@ -149,3 +149,3 @@ /* eslint-disable no-eval */ | ||
const ultraEnroll = async (imageData, simd, config, cb) => { | ||
console.log("Ultra Enroll starting"); | ||
console.log('Ultra Enroll starting'); | ||
privid_wasm_result = cb; | ||
@@ -692,9 +692,9 @@ | ||
wasmSession /* session pointer */, | ||
configInputPtr, | ||
configInputSize, | ||
imageInputPtr /* input images */, | ||
width: imageInput.width /* width of one image */, | ||
height: imageInput.height /* height of one image */, | ||
resultFirstPtr /* operation result output buffer */, | ||
resultLenPtr | ||
configInputPtr, | ||
configInputSize, | ||
imageInputPtr /* input images */, | ||
width: imageInput.width /* width of one image */, | ||
height: imageInput.height /* height of one image */, | ||
resultFirstPtr /* operation result output buffer */, | ||
resultLenPtr, | ||
}); | ||
@@ -734,9 +734,9 @@ | ||
const configInputPtr = wasmPrivModules._malloc(configInputSize); | ||
wasmPrivModules.HEAP8.set(config_bytes, configInputPtr / config_bytes.BYTES_PER_ELEMENT); | ||
console.log("image Input", imageInput); | ||
console.log('image Input', imageInput); | ||
const imageInputSize = imageInput?.data?.length * imageInput?.data?.BYTES_PER_ELEMENT; | ||
const imageInputPtr = wasmPrivModules._malloc(imageInputSize); | ||
console.log("Input image Size:", imageInputSize); | ||
console.log('Input image Size:', imageInputSize); | ||
wasmPrivModules.HEAPU8.set(new Uint8Array(imageInput.data), imageInputPtr); | ||
@@ -750,8 +750,8 @@ // wasmPrivModules.HEAP8.set(imageInput, imageInputPtr / imageInput?.data?.BYTES_PER_ELEMENT); | ||
configInputPtr, | ||
configInputSize, | ||
imageInputPtr /* input images */, | ||
width: imageInput.width /* width of one image */, | ||
height: imageInput.height /* height of one image */, | ||
resultFirstPtr /* operation result output buffer */, | ||
resultLenPtr /* operation result buffer length */, | ||
configInputSize, | ||
imageInputPtr /* input images */, | ||
width: imageInput.width /* width of one image */, | ||
height: imageInput.height /* height of one image */, | ||
resultFirstPtr /* operation result output buffer */, | ||
resultLenPtr /* operation result buffer length */, | ||
}); | ||
@@ -780,2 +780,12 @@ | ||
const checkIfModelsLoaded = (isEnroll = true) => { | ||
try { | ||
const isLoaded = wasmPrivModules._privid_check_models(isEnroll); | ||
return isLoaded; | ||
} catch (e) { | ||
console.log(e); | ||
return 0; | ||
} | ||
}; | ||
Comlink.expose({ | ||
@@ -789,2 +799,3 @@ ultraEnroll, | ||
pkiEncrypt, | ||
checkIfModelsLoaded, | ||
}); |
35769004
5403