BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
bech32.h
Go to the documentation of this file.
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.
4 
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.
11 
12 #ifndef BITCOIN_BECH32_H
13 #define BITCOIN_BECH32_H
14 
15 #include <stdint.h>
16 #include <string>
17 #include <vector>
18 
19 namespace bech32
20 {
21 
23 std::string Encode(const std::string& hrp, const std::vector<uint8_t>& values);
24 
26 std::pair<std::string, std::vector<uint8_t>> Decode(const std::string& str);
27 
28 } // namespace bech32
29 
30 #endif // BITCOIN_BECH32_H
std::pair< std::string, data > Decode(const std::string &str)
Decode a Bech32 string.
Definition: bech32.cpp:159
std::string Encode(const std::string &hrp, const data &values)
Encode a Bech32 string.
Definition: bech32.cpp:147