ethereum-gen-sign-verify
- Generate an ethereum address.
- Sign any data
- Verify that data.
Working in nodejs and in the browser. That's all.
Install
npm install ethereum-gen-sign-verify
Docs for usage in the browser
Include the script.
<script src="node_modules/ethereum-gen-sign-verify/browser/lib.js"></script>
Now you can use the global object "ethGSV"
const keypair = ethGSV.generateKeyPair();
const signature = ethGSV.sign('SomeDataAsString', keypair.privateKey);
const isValid = ethGSV.verify('SomeDataAsString', signature, keypair.address);
Docs for usage in node.js
Similar to the browser version, just import it with require
const ethGSV = require('ethereum-gen-sign-verify');
const keypair = ethGSV.generateKeyPair();
const signature = ethGSV.sign('SomeDataAsString', keypair.privateKey);
const isValid = ethGSV.verify('SomeDataAsString', signature, keypair.address);