Bitcoin ABC  0.24.7
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 #include <span.h>
21 
22 #include <string>
23 #include <vector>
24 
28 std::string EncodeBase58(Span<const uint8_t> input);
29 
35 NODISCARD bool DecodeBase58(const char *psz, std::vector<uint8_t> &vchRet,
36  int max_ret_len);
37 
42 NODISCARD bool DecodeBase58(const std::string &str,
43  std::vector<uint8_t> &vchRet, int max_ret_len);
44 
48 std::string EncodeBase58Check(Span<const uint8_t> input);
49 
54 NODISCARD bool DecodeBase58Check(const char *psz, std::vector<uint8_t> &vchRet,
55  int max_ret_len);
56 
61 NODISCARD bool DecodeBase58Check(const std::string &str,
62  std::vector<uint8_t> &vchRet, int max_ret_len);
63 
64 #endif // BITCOIN_BASE58_H
DecodeBase58
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
#define NODISCARD
Definition: attributes.h:18
Span
A Span is an object that can refer to a contiguous sequence of objects.
Definition: span.h:83
DecodeBase58Check
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),...
Definition: base58.cpp:159
EncodeBase58
std::string EncodeBase58(Span< const uint8_t > input)
Why base-58 instead of standard base-64 encoding?
Definition: base58.cpp:100
EncodeBase58Check
std::string EncodeBase58Check(Span< const uint8_t > input)
Encode a byte span into a base58-encoded string, including checksum.
Definition: base58.cpp:151
span.h
attributes.h