pow-equix-wasm 0.2.0 → 0.2.1
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/dist/empreinte.json +1 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/empreinte.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,9 +5,12 @@ var TAILLE_SOLUTION = 16;
|
|
|
5
5
|
var TAILLE_PART = 4 + TAILLE_SOLUTION;
|
|
6
6
|
var PARTS_MAX = 64;
|
|
7
7
|
var EFFORT_MAX = 2 ** 32 - 1;
|
|
8
|
+
function estArrayBuffer(valeur) {
|
|
9
|
+
return Object.prototype.toString.call(valeur) === "[object ArrayBuffer]";
|
|
10
|
+
}
|
|
8
11
|
function exportsValides(exports) {
|
|
9
12
|
const candidat = exports;
|
|
10
|
-
return typeof candidat === "object" && candidat !== null && candidat.memory?.buffer
|
|
13
|
+
return typeof candidat === "object" && candidat !== null && estArrayBuffer(candidat.memory?.buffer) && ["tampon_adresse", "tampon_taille", "graine_max", "version_format", "verifier", "essayer"].every((nom) => typeof candidat[nom] === "function");
|
|
11
14
|
}
|
|
12
15
|
function controler(exports) {
|
|
13
16
|
if (!exportsValides(exports))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pow-equix-wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Preuve de travail Equi-X (Tor/Arti) en WebAssembly, avec repli en JavaScript pur : un seul module qui résout dans le navigateur et vérifie côté serveur",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"proof-of-work",
|