Bitcoin ABC  0.26.3
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,
55  std::vector<uint8_t> &vchRet,
56  int max_ret_len);
57 
62 [[nodiscard]] bool DecodeBase58Check(const std::string &str,
63  std::vector<uint8_t> &vchRet,
64  int max_ret_len);
65 
66 #endif // BITCOIN_BASE58_H
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
std::string EncodeBase58(Span< const uint8_t > input)
Why base-58 instead of standard base-64 encoding?
Definition: base58.cpp:100
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
std::string EncodeBase58Check(Span< const uint8_t > input)
Encode a byte span into a base58-encoded string, including checksum.
Definition: base58.cpp:151
A Span is an object that can refer to a contiguous sequence of objects.
Definition: span.h:93