Bitcoin Core  0.20.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 #include <span.h>
19 
20 #include <string>
21 #include <vector>
22 
26 std::string EncodeBase58(Span<const unsigned char> input);
27 
32 NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len);
33 
38 
43 NODISCARD bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret_len);
44 
45 #endif // BITCOIN_BASE58_H
NODISCARD bool DecodeBase58Check(const std::string &str, std::vector< unsigned char > &vchRet, int max_ret_len)
Decode a base58-encoded string (str) that includes a checksum into a byte vector (vchRet), return true if decoding is successful.
Definition: base58.cpp:161
std::string EncodeBase58(Span< const unsigned char > input)
Why base-58 instead of standard base-64 encoding?
Definition: base58.cpp:87
NODISCARD bool DecodeBase58(const std::string &str, std::vector< unsigned char > &vchRet, int max_ret_len)
Decode a base58-encoded string (str) into a byte vector (vchRet).
Definition: base58.cpp:127
#define NODISCARD
Definition: attributes.h:18
A Span is an object that can refer to a contiguous sequence of objects.
Definition: span.h:82
std::string EncodeBase58Check(Span< const unsigned char > input)
Encode a byte span into a base58-encoded string, including checksum.
Definition: base58.cpp:135