34 s <<
" " << (uint64_t)_n <<
" (0x" << std::hex << (uint64_t)_n <<
")";
35 else if (!~(_n >> 64))
36 s <<
" " << (int64_t)_n <<
" (0x" << std::hex << (int64_t)_n <<
")";
37 else if ((_n >> 160) == 0)
50 s << _n <<
"(0x" << n <<
")";
53 return "\"" + raw +
"\"";
66 else if (_js ==
"earliest")
68 else if (_js ==
"pending")
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
std::string toHex(T const &_data, int _w=2, HexPrefix _prefix=HexPrefix::DontAdd)
h160 right160(h256 const &_t)
Convert the given value into h160 (160-bit unsigned integer) using the right 20 bytes.
BlockNumber jsToBlockNumber(std::string const &_js)
Convert to a block number, a bit like jsToInt, except that it correctly recognises "pending" and "lat...
std::string prettyU256(u256 _n, bool _abridged)
Convert u256 into user-readable string. Returns int/hex value of 64 bits int, hex of 160 bits FixedHa...
string fromRaw(h256 _n)
Convert h256 into user-readable string (by directly using std::string constructor). If it can't be interpreted as an ASCII string, empty string is returned.
Fixed-size raw-byte array container type, with an API optimised for storing hashes.
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
std::string abridged() const
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< N *8, N *8, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > jsToInt(std::string const &_s)
Convert a string representation of a number to an int String can be a normal decimal number...