20 #include <ripple/beast/utility/Zero.h>
21 #include <ripple/protocol/Serializer.h>
22 #include <ripple/protocol/SystemParameters.h>
23 #include <ripple/protocol/UintTypes.h>
33 "abcdefghijklmnopqrstuvwxyz"
34 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
38 if (currency == beast::zero)
45 from_hex_text<Currency>(
"FFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF"));
47 if ((currency & sIsoBits).isZero())
50 int const isoOffset = 12;
53 currency.data() + isoOffset, currency.data() + isoOffset + 3);
58 (iso.find_first_not_of(allowed_characters) == std::string::npos))
72 currency = beast::zero;
76 static const int CURRENCY_CODE_LENGTH = 3;
77 if (code.
size() == CURRENCY_CODE_LENGTH)
79 Blob codeBlob(CURRENCY_CODE_LENGTH);
82 return ::toupper(static_cast<unsigned char>(c));
96 if (40 == code.
size())
97 return currency.
SetHex(code);
114 static Currency const currency(beast::zero);
128 static Currency const currency(0x5852500000000000);
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
static std::string const & systemCurrencyCode()
bool to_currency(Currency ¤cy, std::string const &code)
Tries to convert a string to a Currency, returns true on success.
Currency const & noCurrency()
A placeholder for empty currencies.
std::string to_string(ListDisposition disposition)
int addRaw(Blob const &vector)
bool SetHex(const char *psz, bool bStrict=false)
Parse a hex string into a base_uint The input can be:
bool get160(base_uint< 160, Tag > &o, int offset) const
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
int addZeros(size_t uBytes)
std::string strHex(FwdIt begin, FwdIt end)
Currency const & xrpCurrency()
XRP currency.