Open raphaelsoul opened 6 years ago
A workround example
const checkPrivKey = (privKey) => {
return PrivateKey.fromWif(privKey).toString() === privKey;
}
have simply fixed here. Could I send a PR? https://github.com/steemit/steem-js/commit/acff06b039d5883e4e2395d10014a67ba8130d77?diff=split
isWif() has a bug due to native javascript runtime.
Expected behavior
The validPrivKey is generate by a scripts calls steem-js API. and edit last code to '6' we got an invalid privkey which should not pass checksum validation.
Exept both to false.
Actual behavior
isWif
return true to an modified privkey with broken checksum.Environment information
can be reproduced both in browser and node.js
https://github.com/steemit/steem-js/blob/master/src/auth/ecc/src/key_private.js#L65 the bug occurs in this line