varint

"varint", or long form variable-length integer, is a way to encode arbitrarily-large integer. It's used in a lot of places in many different variants, but the main idea is as follows:

For example, when seen as the most basic form of varint described above, the octet sequence 0xfb 0x67 is read as follows:

Big-endian varint can be seen in WBMP. Little-endian varint can be seen in Git, which curiously uses 3 different variants.


2025.4.15

Back