mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Alphabet class for base58 conversions, Validators work
This commit is contained in:
@@ -62,10 +62,10 @@ void CBase58Data::SetData (int nVersionIn, const unsigned char* pbegin, const un
|
||||
SetData (nVersionIn, (void*)pbegin, pend - pbegin);
|
||||
}
|
||||
|
||||
bool CBase58Data::SetString (const char* psz, unsigned char version, const char* pAlphabet)
|
||||
bool CBase58Data::SetString (const char* psz, unsigned char version, Base58::Alphabet const& alphabet)
|
||||
{
|
||||
Blob vchTemp;
|
||||
Base58::decodeWithCheck (psz, vchTemp, pAlphabet);
|
||||
Base58::decodeWithCheck (psz, vchTemp, alphabet);
|
||||
|
||||
if (vchTemp.empty () || vchTemp[0] != version)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
void SetData (int nVersionIn, const unsigned char* pbegin, const unsigned char* pend);
|
||||
|
||||
public:
|
||||
bool SetString (const char* psz, unsigned char version, const char* pAlphabet = Base58::getCurrentAlphabet ());
|
||||
bool SetString (const char* psz, unsigned char version, Base58::Alphabet const& alphabet = Base58::getCurrentAlphabet ());
|
||||
bool SetString (const std::string& str, unsigned char version);
|
||||
|
||||
std::string ToString () const;
|
||||
|
||||
@@ -348,7 +348,7 @@ std::string RippleAddress::humanAccountID () const
|
||||
}
|
||||
}
|
||||
|
||||
bool RippleAddress::setAccountID (const std::string& strAccountID, const char* pAlphabet)
|
||||
bool RippleAddress::setAccountID (const std::string& strAccountID, Base58::Alphabet const& alphabet)
|
||||
{
|
||||
if (strAccountID.empty ())
|
||||
{
|
||||
@@ -358,7 +358,7 @@ bool RippleAddress::setAccountID (const std::string& strAccountID, const char* p
|
||||
}
|
||||
else
|
||||
{
|
||||
mIsValid = SetString (strAccountID.c_str (), VER_ACCOUNT_ID, pAlphabet);
|
||||
mIsValid = SetString (strAccountID.c_str (), VER_ACCOUNT_ID, alphabet);
|
||||
}
|
||||
|
||||
return mIsValid;
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
std::string humanAccountID () const;
|
||||
|
||||
bool setAccountID (const std::string& strAccountID, const char* pAlphabet = Base58::getCurrentAlphabet ());
|
||||
bool setAccountID (const std::string& strAccountID, Base58::Alphabet const& alphabet = Base58::getCurrentAlphabet ());
|
||||
void setAccountID (const uint160& hash160In);
|
||||
|
||||
static RippleAddress createAccountID (const std::string& strAccountID)
|
||||
|
||||
Reference in New Issue
Block a user