Bitcoin ABC  0.22.13
P2P Digital Currency
base58.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
16 #ifndef BITCOIN_BASE58_H
17 #define BITCOIN_BASE58_H
18 
19 #include <attributes.h>
20 
21 #include <string>
22 #include <vector>
23 
28 std::string EncodeBase58(const uint8_t *pbegin, const uint8_t *pend);
29 
33 std::string EncodeBase58(const std::vector<uint8_t> &vch);
34 
40 NODISCARD bool DecodeBase58(const char *psz, std::vector<uint8_t> &vchRet,
41  int max_ret_len);
42 
47 NODISCARD bool DecodeBase58(const std::string &str,
48  std::vector<uint8_t> &vchRet, int max_ret_len);
49 
53 std::string EncodeBase58Check(const std::vector<uint8_t> &vchIn);
54 
59 NODISCARD bool DecodeBase58Check(const char *psz, std::vector<uint8_t> &vchRet,
60  int max_ret_len);
61 
66 NODISCARD bool DecodeBase58Check(const std::string &str,
67  std::vector<uint8_t> &vchRet, int max_ret_len);
68 
69 #endif // BITCOIN_BASE58_H
std::string EncodeBase58Check(const std::vector< uint8_t > &vchIn)
Encode a byte vector into a base58-encoded string, including checksum.
Definition: base58.cpp:155
std::string EncodeBase58(const uint8_t *pbegin, const uint8_t *pend)
Why base-58 instead of standard base-64 encoding?
Definition: base58.cpp:100
#define NODISCARD
Definition: attributes.h:18
NODISCARD bool DecodeBase58(const char *psz, std::vector< uint8_t > &vchRet, int max_ret_len)
Decode a base58-encoded string (psz) into a byte vector (vchRet).
Definition: base58.cpp:37
NODISCARD bool DecodeBase58Check(const char *psz, std::vector< uint8_t > &vchRet, int max_ret_len)
Decode a base58-encoded string (psz) that includes a checksum into a byte vector (vchRet), return true if decoding is successful.
Definition: base58.cpp:163