Expand description
Utility methods to work on radix 16 nibble.
Constants§
- BIT_
PER_ NIBBLE - Single nibble length in bit.
- CONTENT_
HEADER_ SIZE - Size of header.
- NIBBLE_
LENGTH - Number of child for a branch (trie radix).
- NIBBLE_
PER_ BYTE - Number of nibble per byte.
- PADDING_
BITMASK - Nibble (half a byte).
- SPLIT_
SHIFTS - The nibble shifts needed to align. We use two value, one is a left shift and the other is a right shift.
Functions§
- at
- Get u8 nibble value at a given index in a
NibbleSlice
. - at_left
- Get u8 nibble value at a given index of a byte.
- biggest_
depth - Count the biggest common depth between two left aligned packed nibble slice.
- left_
common - Calculate the number of common nibble between two left aligned bytes.
- left_
nibble_ at - Get u8 nibble value at a given index in a left aligned array.
- number_
padding - Calculate the number of needed padding a array of nibble length
i
. - pad_
left - Mask a byte, keeping left nibble.
- pad_
right - Mask a byte, keeping right byte.
- push_
at_ left - Push u8 nibble value at a given index into an existing byte.
- shift_
key - Shifts right aligned key to add a given left offset. Resulting in possibly padding at both left and right (example usage when combining two keys).