Expand description
LEB128 varint coding for posting lists.
Posting entries store fact-id deltas; lists are sorted by construction (fact ids are assigned monotonically), so deltas are small and most entries take 1 byte instead of 4.
Constants§
- MAX_
VARINT - Maximum encoded size of a
u32(5 × 7 bits ≥ 32 bits).
Functions§
- decode_
u32 - Decodes one
u32from the front ofbytes, returning the value and the number of bytes consumed.Noneon truncated input or a value that does not fit 32 bits (a 5th byte with more than 4 payload bits, or a continuation bit on the 5th byte). - encode_
u32 - Encodes
vintoout, returning the number of bytes written (1..=5).