This commit is contained in:
陆柯 2020-02-26 10:13:43 +08:00
parent 983750e7f5
commit 7345c64de6

View File

@ -185,9 +185,7 @@ module.exports = {
// let naclPubkey = nacl.sign.keyPair.fromSeed()
}else { // 默认使用 eccrypto
try {
await eccrypto.verify(Buffer.from(pubkey, 'hex'),
this.hash(data, {output:'buf'},
Buffer.from(signature, 'hex')) // 如果给signature添加1位hexeccrypto 的 verify结果也是true! 估计因为一位hex不被转成字节。
await eccrypto.verify(Buffer.from(pubkey, 'hex'), this.hash(data, {output:'buf'}), Buffer.from(signature, 'hex')) // 如果给signature添加1位hexeccrypto 的 verify结果也是true! 估计因为一位hex不被转成字节。
return true
}catch(exception){
return false