package
0.0.0-20210331065242-323b27c6239d
Repository: https://github.com/classzz/czzutil.git
Documentation: pkg.go.dev
# README
bech32
Package bech32 provides a Go implementation of the bech32 format specified in BIP 173.
Test vectors from BIP 173 are added to ensure compatibility with the BIP.
Note this package is NOT use by the CashAddress format as that uses a different bech32 encoding. It's left here for the sheer utility of having that package.
Installation and Updating
$ go get -u github.com/gcash/bchutil/bech32
Examples
- Bech32 decode Example Demonstrates how to decode a bech32 encoded string.
- Bech32 encode Example Demonstrates how to encode data into a bech32 string.
License
Package bech32 is licensed under the copyfree ISC License.
# Functions
ConvertBits converts a byte slice where each byte is encoding fromBits bits, to a byte slice where each byte is encoding toBits bits.
Decode decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.
Encode encodes a byte slice into a bech32 string with the human-readable part hrb.