Skip to content

Commit

Permalink
👽️ Patch big-integer to support hex string
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Jun 27, 2023
1 parent 0b3ac46 commit 2ef42ec
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions patches/big-integer+1.6.51.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/node_modules/big-integer/BigInteger.js b/node_modules/big-integer/BigInteger.js
index c4263d5..cae03c7 100644
--- a/node_modules/big-integer/BigInteger.js
+++ b/node_modules/big-integer/BigInteger.js
@@ -10,6 +10,10 @@ var bigInt = (function (undefined) {
var supportsNativeBigInt = typeof BigInt === "function";

function Integer(v, radix, alphabet, caseSensitive) {
+ if (v.toString().includes('0x')) {
+ v = v.substring(2);
+ radix = 16;
+ }
if (typeof v === "undefined") return Integer[0];
if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);
return parseValue(v);

0 comments on commit 2ef42ec

Please sign in to comment.