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;
30 ConvertBits<8, 5, true>([&](
unsigned char c) { input.push_back(c); }, buffer.begin(), buffer.end());
39 assert(r2.encoding == encoding);
@ INVALID
Failed decoding.
@ BECH32
Bech32 encoding as defined in BIP173.
@ BECH32M
Bech32m encoding as defined in BIP350.
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)