36377a3c8c
BIP173 specifically calls out that encoders must always output an all lowercase bech32 string and that the lowercase form is used when determining a character's value for calculating the checksum. Currently, the implementation does not respect either of those requirements. This modifies the Encode function to convert the provided HRP to lowercase to ensure the requirements are satisfied and adds tests accordingly. |
||
---|---|---|
.. | ||
bech32.go | ||
bech32_test.go | ||
doc.go | ||
error.go | ||
example_test.go | ||
README.md |
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.
Installation and Updating
$ go get -u github.com/btcsuite/btcutil/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.