开发者社区> 镜像站> NPM> @hyperdivision/eth-checksum
@hyperdivision/eth-checksum
Ethereum address checksum with EIP-1191 support
Last updated 9 months ago by emilbayes .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hyperdivision/eth-checksum 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (9 months ago)

1 Versions

  • 1.0.0                                ...           9 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (2)
Dependents (0)
None