20 #include <ripple/protocol/Serializer.h>
21 #include <ripple/protocol/SystemParameters.h>
22 #include <ripple/protocol/UintTypes.h>
23 #include <ripple/beast/utility/Zero.h>
32 "abcdefghijklmnopqrstuvwxyz"
33 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
37 if (currency == beast::zero)
44 from_hex_text<Currency>(
"FFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF"));
46 if ((currency & sIsoBits).isZero ())
49 int const isoOffset = 12;
52 currency.data () + isoOffset,
53 currency.data () + isoOffset + 3);
58 (iso.find_first_not_of (allowed_characters) == std::string::npos))
71 currency = beast::zero;
75 static const int CURRENCY_CODE_LENGTH = 3;
76 if (code.
size () == CURRENCY_CODE_LENGTH)
78 Blob codeBlob (CURRENCY_CODE_LENGTH);
83 return ::toupper(static_cast<unsigned char>(c));
97 if (40 == code.
size ())
98 return currency.
SetHex (code);
113 static Currency const currency(beast::zero);
125 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.