From fcf41dd77e95fffab0e72671cc45546f481cd425 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 3 Apr 2022 14:32:30 +0800 Subject: [PATCH] substring change to substr --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5eafa43..72101db 100644 --- a/index.js +++ b/index.js @@ -1351,7 +1351,7 @@ class TICrypto { const prime = new BigInt('fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f', 16) // 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1 const pIdent = new BigInt('3fffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffff0c', 16) // prime.add(1).divide(4); var signY = new Number(compressed[1]) - 2 - var x = new BigInt(compressed.substring(2), 16) + var x = new BigInt(compressed.substr(2), 16) var y = x.modPow(3, prime).add(7).mod(prime).modPow(pIdent, prime) // y mod p = +-(x^3 + 7)^((p+1)/4) mod p if (y.mod(2).toJSNumber() !== signY) { // If the parity doesn't match it's the *other* root