u
This commit is contained in:
parent
983750e7f5
commit
7345c64de6
4
index.js
4
index.js
@ -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位hex,eccrypto 的 verify结果也是true! 估计因为一位hex不被转成字节。
|
||||
await eccrypto.verify(Buffer.from(pubkey, 'hex'), this.hash(data, {output:'buf'}), Buffer.from(signature, 'hex')) // 如果给signature添加1位hex,eccrypto 的 verify结果也是true! 估计因为一位hex不被转成字节。
|
||||
return true
|
||||
}catch(exception){
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user