Browse Source

Fix 0x parser in old versions of node

master
Jordi Baylina 5 years ago
parent
commit
f122fa202f
No known key found for this signature in database GPG Key ID: 7480C80C1BE43112
2 changed files with 11 additions and 1 deletions
  1. +0
    -0
      cli.js
  2. +11
    -1
      src/bigint.js

+ 0
- 0
cli.js


+ 11
- 1
src/bigint.js

@ -206,7 +206,17 @@ if (typeof(BigInt) != "undefined") {
} 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
wBigInt.genAffine = (q) => {

Loading…
Cancel
Save