ffjavascript
Advanced tools
Comparing version 0.2.56 to 0.2.57
{ | ||
"name": "ffjavascript", | ||
"type": "module", | ||
"version": "0.2.56", | ||
"version": "0.2.57", | ||
"description": "Finite Field Library in Javascript", | ||
@@ -6,0 +6,0 @@ "main": "./build/main.cjs", |
@@ -100,3 +100,3 @@ /* global BigInt */ | ||
i += 4; | ||
} else if (i + 4 <= buff.length) { | ||
} else if (i + 2 <= buff.length) { | ||
res += BigInt(buffV.getUint16(i, true)) << BigInt(i * 8); | ||
@@ -127,7 +127,7 @@ i += 2; | ||
} else if (o + 2 <= len) { | ||
buffV.setUint16(Number(o, r & BigInt(0xffff)), true); | ||
buffV.setUint16(o, Number(r & BigInt(0xffff)), true); | ||
o += 2; | ||
r = r >> BigInt(16); | ||
} else { | ||
buffV.setUint8(Number(o, r & BigInt(0xff)), true); | ||
buffV.setUint8(o, Number(r & BigInt(0xff)), true); | ||
o += 1; | ||
@@ -134,0 +134,0 @@ r = r >> BigInt(8); |
@@ -30,2 +30,20 @@ import assert from "assert"; | ||
}); | ||
it("Should generate buffer little-endian without trailing non-zero element", () => { | ||
for (let i = 1; i < 33; i++) { | ||
var buff = utilsN.leInt2Buff(BigInt(42), i); | ||
for (let t = 1; t < buff.length; t++){ | ||
assert(buff[t] === 0, true); | ||
} | ||
} | ||
}); | ||
it("Should generate buffer big-endian without trailing non-zero element", () => { | ||
for (let i = 1; i < 33; i++) { | ||
var buff = utilsN.beInt2Buff(BigInt(42), i); | ||
for (let t = 0; t < buff.length - 1; t++){ | ||
assert(buff[t] === 0, true); | ||
} | ||
} | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
418649
11043