14 #ifndef BITCOIN_BECH32_H
15 #define BITCOIN_BECH32_H
46 DecodeResult
Decode(
const std::string& str);
49 std::pair<std::string, std::vector<int>>
LocateErrors(
const std::string& str);
@ INVALID
Failed decoding.
@ BECH32
Bech32 encoding as defined in BIP173.
@ BECH32M
Bech32m encoding as defined in BIP350.
std::string Encode(Encoding encoding, const std::string &hrp, const data &values)
Encode a Bech32 or Bech32m string.
DecodeResult Decode(const std::string &str)
Decode a Bech32 or Bech32m string.
std::pair< std::string, std::vector< int > > LocateErrors(const std::string &str)
Find index of an incorrect character in a Bech32 string.
static const int64_t values[]
A selection of numbers that do not trigger int64_t overflow when added/subtracted.
Encoding encoding
What encoding was detected in the result; Encoding::INVALID if failed.
std::vector< uint8_t > data
The payload (excluding checksum)
DecodeResult(Encoding enc, std::string &&h, std::vector< uint8_t > &&d)
std::string hrp
The human readable part.