mirror of
https://github.com/arnaucube/snarkjs.git
synced 2026-02-28 05:56:44 +01:00
Fix 0x parser in old versions of node
This commit is contained in:
@@ -206,7 +206,17 @@ if (typeof(BigInt) != "undefined") {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
wBigInt = bigInt;
|
var oldProto = bigInt.prototype;
|
||||||
|
wBigInt = function(a) {
|
||||||
|
if ((typeof a == "string") && (a.slice(0,2) == "0x")) {
|
||||||
|
return bigInt(a.slice(2), 16);
|
||||||
|
} else {
|
||||||
|
return bigInt(a);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
wBigInt.one = bigInt.one;
|
||||||
|
wBigInt.zero = bigInt.zero;
|
||||||
|
wBigInt.prototype = oldProto;
|
||||||
|
|
||||||
// Affine
|
// Affine
|
||||||
wBigInt.genAffine = (q) => {
|
wBigInt.genAffine = (q) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user