lbcutil/bech32
Dave Collins d63d9f2b44 bech32: Add base256 conversion convenience funcs.
Since bech32 itself works with data encoded with 5 bits per byte (aka
base32) padded out to the nearest byte boundary, the existing functions
for Encode and Decode accept and return data encoded that way.

However, the most common way to use bech32 is to encode data that is
already encoded with 8 bits per byte (aka base256) without padding which
means it is up to the caller to use the ConvertBits function properly to
convert between the two encodings.

Consequently, this introduces two convenience functions for working
directly with base256-encoded data named EncodeFromBase256 and
DecodeToBase256 along with a full set of tests to ensure they work
expected.
2020-12-01 09:42:36 -05:00
..
bech32.go bech32: Add base256 conversion convenience funcs. 2020-12-01 09:42:36 -05:00
bech32_test.go bech32: Add base256 conversion convenience funcs. 2020-12-01 09:42:36 -05:00
doc.go bech32: Add bech32 encoding package. 2017-07-25 22:14:01 -05:00
error.go bech32: back port improvements from decred/dcrd@9b88dd0 2020-12-01 09:42:36 -05:00
example_test.go bech32: Ensure HRP is lowercase when encoding. 2020-12-01 09:42:36 -05:00
README.md bech32: Add bech32 encoding package. 2017-07-25 22:14:01 -05:00

bech32

Build Status ISC License GoDoc

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

License

Package bech32 is licensed under the copyfree ISC License.