This is a small utility library for parsing, validating and converting an ethereum address.
npm install nahmii-ethereum-address
Creating a new address from a string:
const EthereumAddress = ;let addr = EthereumAddress;if !addrconsole;
EthereumAddress - constructor()
The constructor can be invoked with either a 20 byte Buffer or an already existing EthereumAddress instance.
Invalid input will throw a
EthereumAddress - from()
from class method is able to construct an EthereumAddress from
strings or BSON Binary objects.
It will either return a new instance of an EthereumAddress or
conversion was not possible.
EthereumAddress - toString()
This method will return a hexadecimal string representation of the address.
EthereumAddress - toBuffer()
This method will return a Buffer containing the address.
EthereumAddress - toBinary()
This method will return a BSON Binary containing the address.