23 if (decoded.hrp.empty()) {
25 assert(decoded.data.empty());
28 auto reencoded =
bech32::Encode(decoded.encoding, decoded.hrp, decoded.data);
38 for (
size_t i = 0; i < length; ++i) {
54 std::vector<uint8_t> converted_input;
64 assert(decoded.encoding == encoding);
65 assert(decoded.hrp == hrp);
66 assert(decoded.data == converted_input);
std::string ConsumeRandomLengthString(size_t max_length)
std::vector< T > ConsumeBytes(size_t num_bytes)
T ConsumeIntegralInRange(T min, T max)
@ 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.
static constexpr size_t CHECKSUM_SIZE
static constexpr char SEPARATOR
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.
std::string GenerateRandomHRP(FuzzedDataProvider &fdp)
std::string random_string(uint32_t length)