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()
|
// let naclPubkey = nacl.sign.keyPair.fromSeed()
|
||||||
}else { // 默认使用 eccrypto
|
}else { // 默认使用 eccrypto
|
||||||
try {
|
try {
|
||||||
await eccrypto.verify(Buffer.from(pubkey, 'hex'),
|
await eccrypto.verify(Buffer.from(pubkey, 'hex'), this.hash(data, {output:'buf'}), Buffer.from(signature, 'hex')) // 如果给signature添加1位hex,eccrypto 的 verify结果也是true! 估计因为一位hex不被转成字节。
|
||||||
this.hash(data, {output:'buf'},
|
|
||||||
Buffer.from(signature, 'hex')) // 如果给signature添加1位hex,eccrypto 的 verify结果也是true! 估计因为一位hex不被转成字节。
|
|
||||||
return true
|
return true
|
||||||
}catch(exception){
|
}catch(exception){
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user