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 }