1.0.4 • Published 7 years ago
eckey-util v1.0.4
ECKey utils
Elliptic curve signature, public and private key generation and public key verification are realized. Signature algorithm ECDSA
npm i eckey-util --saveCreate private key
const ECKey = require('eckey-util')
ECKey.createPrivate()Get public key
ECKey.getPublicKey(privateKey)Sign
let signed = ECKey.sign('Hello world!', privateKey)SignHash
let signed = ECKey.signHash(ECKey.createHash('Hello world!'), privateKey)Verify
ECKey.verify('Hello world!', signed, publicKey)VerifyHash
ECKey.verifyHash(ECKey.createHash('Hello world!'), Buffer.from(signed, 'hex'), publicKey)