1.0.9 • Published 2 years ago

bech32-converting v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

bech32-converting

This library is designed to convert bech32 addresses to hex and vice versa.

You can use any prefix and address, it will match bech32 address on blockchain node.

Installation

npm install bech32-converting

Usage

import converter from "bech32-converting"

converter('prefix').toHex('address')
converter('prefix').toBech32('address')

// Example

converter('eth').toBech32('0xf9e0bd5927557a39e246f88774e6b209389731db')
// eth1l8st6kf824arncjxlzrhfe4jpyufwvwm5f5cyp

converter('eth').toHex('eth1l8st6kf824arncjxlzrhfe4jpyufwvwm5f5cyp')
// 0xf9e0bd5927557a39e246f88774e6b209389731db