Changeset View
Changeset View
Standalone View
Standalone View
src/base58.h
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
bool operator>=(const CBase58Data &b58) const { | bool operator>=(const CBase58Data &b58) const { | ||||
return CompareTo(b58) >= 0; | return CompareTo(b58) >= 0; | ||||
} | } | ||||
bool operator<(const CBase58Data &b58) const { return CompareTo(b58) < 0; } | bool operator<(const CBase58Data &b58) const { return CompareTo(b58) < 0; } | ||||
bool operator>(const CBase58Data &b58) const { return CompareTo(b58) > 0; } | bool operator>(const CBase58Data &b58) const { return CompareTo(b58) > 0; } | ||||
}; | }; | ||||
/** | CKey DecodeSecret(const std::string &str); | ||||
* A base58-encoded secret key | std::string EncodeSecret(const CKey &key); | ||||
*/ | |||||
class CBitcoinSecret : public CBase58Data { | |||||
public: | |||||
void SetKey(const CKey &vchSecret); | |||||
CKey GetKey(); | |||||
bool IsValid() const; | |||||
bool SetString(const char *pszSecret); | |||||
bool SetString(const std::string &strSecret); | |||||
CBitcoinSecret(const CKey &vchSecret) { SetKey(vchSecret); } | |||||
CBitcoinSecret() {} | |||||
}; | |||||
template <typename K, int Size, CChainParams::Base58Type Type> | template <typename K, int Size, CChainParams::Base58Type Type> | ||||
class CBitcoinExtKeyBase : public CBase58Data { | class CBitcoinExtKeyBase : public CBase58Data { | ||||
public: | public: | ||||
void SetKey(const K &key) { | void SetKey(const K &key) { | ||||
uint8_t vch[Size]; | uint8_t vch[Size]; | ||||
key.Encode(vch); | key.Encode(vch); | ||||
SetData(Params().Base58Prefix(Type), vch, vch + Size); | SetData(Params().Base58Prefix(Type), vch, vch + Size); | ||||
Show All 33 Lines |