encoding/bech32/src/bech32_utils library
Bech32 bit-packing (8-bit bytes <-> 5-bit groups), string framing (hrp + separator + data + checksum), and the shared encode/decode scaffolding both the standard Bech32 and BCH/SegWit variants build on.
The character <-> 5-bit-value lookup is a single const array indexed
directly by code unit, computed once at compile time - not a per
character charset.indexOf(...)/charset.contains(...) scan (which,
on top of being O(32) per character, also allocated a fresh 1-character
String for every character just to do the lookup).
Classes
- Bech32BaseConst
- Constants for Bech32 encoding/decoding.
- Bech32BaseUtils
- Bit-packing between 8-bit bytes and Bech32's 5-bit groups.
- Bech32DecoderBase
- Bech32EncoderBase
-
Shared string framing:
hrp+ separator + data-as-charset-chars + checksum-as-charset-chars.