18 const std::string random_string(buffer.begin(), buffer.end());
25 const std::string reencoded =
bech32::Encode(r1.encoding, r1.hrp, r1.data);
29 std::vector<unsigned char> input;
39 assert(r2.encoding == encoding);
@ INVALID
Failed decoding.
@ BECH32
Bech32 encoding as defined in BIP173.
@ BECH32M
Bech32m encoding as defined in BIP350.
@ BECH32
BIP173/350 imposed character limit for Bech32(m) encoded addresses. This guarantees finding up to 4 e...
DecodeResult Decode(const std::string &str, CharLimit limit)
Decode a Bech32 or Bech32m string.
std::string Encode(Encoding encoding, const std::string &hrp, const data &values)
Encode a Bech32 or Bech32m string.
constexpr size_t CHECKSUM_SIZE
The Bech32 and Bech32m checksum size.
bool CaseInsensitiveEqual(const std::string &s1, const std::string &s2)
bool ConvertBits(O outfn, It it, It end, I infn={})
Convert from one power-of-2 number base to another.