Skip to content

Ethereum address checksum with EIP-1191 support

License

Notifications You must be signed in to change notification settings

hyperdivision/eth-checksum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eth-checksum

Build Status

Ethereum address checksum with EIP-1191 support

Usage

var checksum = require('eth-checksum')

console.log(checksum.encode('0x27b1fdb04752bbc536007a920d24acb045561c26'))
console.log(checksum.verify('0x27b1fdb04752bbc536007a920d24acb045561c26'))

// With chain id
console.log(checksum.encode('0x27b1FdB04752BBc536007A920D24ACB045561c26', 30))
console.log(checksum.verify('0x27b1FdB04752BBc536007A920D24ACB045561c26', 30))

API

const addrStr = checksum.encode(address, [chainId = null])

Encode address with optional chainId. Can encode a string or a Buffer

const bool = checksum.verify(address, [chainId = null])

Validate address with optional chainId. Can validate a string or a Buffer

Install

npm install eth-checksum

License

ISC

About

Ethereum address checksum with EIP-1191 support

Resources

License

Stars

Watchers

Forks

Packages