1.0.1 • Published 5 years ago
hashfish v1.0.1
hashfish
npm install hashfish --save
how to use:
require
const hashfish = require("hashfish");
wallet generator
const wallet = hashfish.generator();
console.log({
mnemonic: wallet.mnemonic,
privateKey: wallet.privateKey.toWif().toString(),
publicKey: wallet.publicKey.toString(),
address: wallet.address.toString()
});
sign
const text = "hello";
const signed = hashfish.sign(text, wallet.privateKey);
const signed2 = hashfish.sign(text, hashfish.getPrivateKeyFromWifString(wallet.privateKey.toWif()));
console.log(signed)
console.log(signed2);
verifySign
console.log(hashfish.verifySign(text, signed, wallet.publicKey));
console.log(hashfish.verifySign(text, signed, hashfish.getPublicKeyFromPublicKeyString(wallet.publicKey.toString())));