Bitcoin Core  0.19.99
P2P Digital Currency
base58.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 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 
14 #ifndef BITCOIN_BASE58_H
15 #define BITCOIN_BASE58_H
16 
17 #include <attributes.h>
18 
19 #include <string>
20 #include <vector>
21 
26 std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend);
27 
31 std::string EncodeBase58(const std::vector<unsigned char>& vch);
32 
38 NODISCARD bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
39 
44 NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len);
45 
49 std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);
50 
55 NODISCARD bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len);
56 
61 NODISCARD bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len);
62 
63 #endif // BITCOIN_BASE58_H
NODISCARD bool DecodeBase58Check(const char *psz, std::vector< unsigned char > &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:149
#define NODISCARD
Definition: attributes.h:18
std::string EncodeBase58Check(const std::vector< unsigned char > &vchIn)
Encode a byte vector into a base58-encoded string, including checksum.
Definition: base58.cpp:140
NODISCARD bool DecodeBase58(const char *psz, std::vector< unsigned char > &vchRet, int max_ret_len)
Decode a base58-encoded string (psz) into a byte vector (vchRet).
Definition: base58.cpp:38
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend)
Why base-58 instead of standard base-64 encoding?
Definition: base58.cpp:87