Package Exports
- ethereum-private-key-to-address
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ethereum-private-key-to-address) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ethereum-private-key-to-address
Convert an Ethereum private key to a public address
Install
npm install ethereum-private-key-to-address
Getting started
const privateKeyToAddress = require('ethereum-private-key-to-address')
console.log(privateKeyToAddress(Buffer.from('4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d', 'hex'))) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
console.log(privateKeyToAddress('4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d')) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
console.log(privateKeyToAddress('0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d')) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
CLI
Install:
npm install -g ethereum-private-key-to-address
Convert private key to public address:
$ ethereum_private_key_to_address 4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
Test
npm test