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