1 // Copyright (c) 2017 Pieter Wuille
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 // Bech32 is a string encoding format used in newer address types.
6 // The output consists of a human-readable part (alphanumeric), a
7 // separator character (1), and a base32 data section, the last
8 // 6 characters of which are a checksum.
10 // For more information, see BIP 173.
19 /** Encode a Bech32 string. Returns the empty string in case of failure. */
20 std::string
Encode(const std::string
& hrp
, const std::vector
<uint8_t>& values
);
22 /** Decode a Bech32 string. Returns (hrp, data). Empty hrp means failure. */
23 std::pair
<std::string
, std::vector
<uint8_t>> Decode(const std::string
& str
);