From ffad2cc8f690bffdaed0231a9a737cb200272d15 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Thu, 7 May 2020 16:57:19 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=20big-integer=20=E6=B2=A1=E6=9C=89=20sub?= =?UTF-8?q?=20=E6=96=B9=E6=B3=95=EF=BC=8C=E6=94=B9=E6=88=90=20subtract?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5b82276..56d86b5 100644 --- a/index.js +++ b/index.js @@ -622,7 +622,7 @@ module.exports = { distanceSig(hash, sig){ // hash为64hex字符,sig为128hex字符。返回用hex表达的距离。 if (this.isSignature(sig) && this.isHash(hash)){ var hashSig=this.hash(sig) // 把签名也转成32字节的哈希,同样长度方便比较 - return new BigInt(hash,16).sub(new BigInt(hashSig,16)).abs().toString(16) + return new BigInt(hash,16).subtract(new BigInt(hashSig,16)).abs().toString(16) } return null }