32 return (_i & 1) ? (_data[_i / 2] & 15) : (_data[_i / 2] >> 4);
40 while (_beginFirst < _endFirst && _beginSecond < _endSecond &&
nibble(_first, _beginFirst) ==
nibble(_second, _beginSecond))
76 for (; i < _k.
size() && i <
size(); ++i)
77 if (
operator[](i) < _k[i])
79 else if (
operator[](i) > _k[i])
91 for (
unsigned i = 0; i < _m.
size(); ++i)
92 _out << std::hex << (
int)_m[i] << std::dec;
99 auto pl = _twoItem[0].
payload();
100 return (pl[0] & 0x20) != 0;
115 return keyOf(_twoItem[0].payload());
119 std::string
hexPrefixEncode(
bytes const& _hexVector,
bool _leaf =
false,
int _begin = 0,
int _end = -1);
bool operator!=(NibbleSlice _s) const
byte nibble(bytesConstRef _data, unsigned _i)
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
bool operator==(NibbleSlice _k) const
bool isList() const
List value.
byte operator[](unsigned _index) const
std::string hexPrefixEncode(bytes const &_hexVector, bool _leaf, int _begin, int _end)
assert(len-trim+(2 *lenIndices)<=WIDTH)
bool isLeaf(RLP const &_twoItem)
unsigned sharedNibbles(bytesConstRef _first, unsigned _beginFirst, unsigned _endFirst, bytesConstRef _second, unsigned _beginSecond, unsigned _endSecond)
Interprets _first and _second as vectors of nibbles and returns the length of the longest common pref...
NibbleSlice keyOf(bytesConstRef _hpe)
NibbleSlice mid(unsigned _index) const
bytesConstRef payload() const
std::vector< byte > bytes
vector_ref< byte const > bytesConstRef
unsigned shared(NibbleSlice _k) const
std::ostream & operator<<(std::ostream &_out, bytes const &_e)
Nibble-based view on a bytesConstRef.
byte uniqueInUse(RLP const &_orig, byte except)
NibbleSlice(bytesConstRef _data=bytesConstRef(), unsigned _offset=0)
bool isEarlierThan(NibbleSlice _k) const
Determine if we, a full key, are situated prior to a particular key-prefix.
Class for interpreting Recursive Linear-Prefix Data.
bool contains(NibbleSlice _k) const