Merge #11667: Add scripts to dumpwallet RPC
[bitcoinplatinum.git] / src / bech32.h
blob7ef7b22213fe6f5a95e6b4c01bc6222c0c7885ca
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.
9 //
10 // For more information, see BIP 173.
12 #include <stdint.h>
13 #include <string>
14 #include <vector>
16 namespace bech32
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);
25 } // namespace bech32