fixed: big-integer 没有 sub 方法,改成 subtract

This commit is contained in:
陆柯 2020-05-07 16:57:19 +08:00
parent 3145d4864c
commit ffad2cc8f6

View File

@ -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
}