[][src]Module subtle_encoding::bech32

Bech32 (BIP-173) checksummed Base32 data encoding (WARNING: preview!)

NOTE: This implementation is not yet constant time, but we intend to make it such. It is provided as a preview of an upcoming feature, and is not enabled by default.

To enable it, add the following cargo feature: bech32-preview

Structs

Bech32

Bech32 encoder/decoder

Constants

DEFAULT_CHARSET

Bech32 default alphabet (lower case)

DEFAULT_CHARSET_UPCASE

Bech32 default alphabet (upper case)

DEFAULT_SEPARATOR

Default separator character

MAX_LENGTH

Maximum length of a bech32 string

Functions

decode

Decode the given data from lower-case Bech32, returning a 2-tuple of the "human readable part" of the message as a String and a Vec<u8> of data, or an Error if decoding failed.

decode_upper

Decode the given data from upper-case Bech32, returning a 2-tuple of the "human readable part" of the message as a String and a Vec<u8> of data, or an Error if decoding failed.

encode

Encode the given data as lower-case Bech32, returning a String

encode_upper

Encode the given data as upper-case Bech32, returning a Vec<u8>