14 #ifndef BITCOIN_BASE58_H
15 #define BITCOIN_BASE58_H
28 std::string
EncodeBase58(
const unsigned char* pbegin,
const unsigned char* pend);
33 std::string
EncodeBase58(
const std::vector<unsigned char>& vch);
40 bool DecodeBase58(
const char* psz, std::vector<unsigned char>& vchRet);
46 bool DecodeBase58(
const std::string& str, std::vector<unsigned char>& vchRet);
57 inline bool DecodeBase58Check(
const char* psz, std::vector<unsigned char>& vchRet);
63 inline bool DecodeBase58Check(
const std::string& str, std::vector<unsigned char>& vchRet);
75 typedef std::vector<unsigned char, zero_after_free_allocator<unsigned char> >
vector_uchar;
79 void SetData(
const std::vector<unsigned char> &vchVersionIn,
const void* pdata,
size_t nSize);
80 void SetData(
const std::vector<unsigned char> &vchVersionIn,
const unsigned char *pbegin,
const unsigned char *pend);
83 bool SetString(
const char* psz,
unsigned int nVersionBytes = 1);
128 bool SetString(
const std::string& strSecret);
138 unsigned char vch[Size];
159 #endif // BITCOIN_BASE58_H
void SetKey(const CKey &vchSecret)
CBitcoinAddress(const CTxDestination &dest)
bool DecodeBase58(const char *psz, std::vector< unsigned char > &vchRet)
Decode a base58-encoded string (psz) into a byte vector (vchRet).
CBitcoinExtKeyBase< CExtKey, 74, CChainParams::EXT_SECRET_KEY > CBitcoinExtKey
base58-encoded Bitcoin addresses.
bool DecodeBase58Check(const char *psz, std::vector< unsigned char > &vchRet)
Decode a base58-encoded string (psz) that includes a checksum into a byte vector (vchRet), return true if decoding is successful.
void SetData(const std::vector< unsigned char > &vchVersionIn, const void *pdata, size_t nSize)
void SetKey(const K &key)
CTxDestination Get() const
bool GetKeyID(CKeyID &keyID) const
bool SetString(const char *pszSecret)
std::vector< unsigned char, zero_after_free_allocator< unsigned char > > vector_uchar
Base class for all base58-encoded data.
bool Set(const CKeyID &id)
A base58-encoded secret key.
bool operator==(const CBase58Data &b58) const
std::string ToString() const
bool operator>(const CBase58Data &b58) const
bool SetString(const char *psz, unsigned int nVersionBytes=1)
std::string EncodeBase58Check(const std::vector< unsigned char > &vchIn)
Encode a byte vector into a base58-encoded string, including checksum.
CBitcoinSecret(const CKey &vchSecret)
const CChainParams & Params()
Return the currently selected parameters.
A reference to a CKey: the Hash160 of its serialized public key.
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend)
Encode a byte sequence as a base58-encoded string.
CBitcoinExtKeyBase(const K &key)
A reference to a CScript: the Hash160 of its serialization (see script.h)
bool operator<(const CBase58Data &b58) const
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
An encapsulated private key.
CBitcoinAddress(const char *pszAddress)
CBitcoinExtKeyBase< CExtPubKey, 74, CChainParams::EXT_PUBLIC_KEY > CBitcoinExtPubKey
CBitcoinAddress(const std::string &strAddress)
std::vector< unsigned char > vchVersion
bool operator<=(const CBase58Data &b58) const
int CompareTo(const CBase58Data &b58) const
bool operator>=(const CBase58Data &b58) const