3 ms·
This reminds me of the varint encoding used by QUIC, but I've never implemented it. Anyone know the differences?
by apitman 4mo ago
This reminds me of the varint encoding used by QUIC, but I've never implemented it. Anyone know the differences?
- raphlinus 4mo agoSimilar, in that it encodes length in the first byte. The differences are: * It does not require canonicality, it allows multiple encodings of the same value. To make things even more fun, the QUIC spec requires shortest encoding in some uses but not others. * It uses 2 bits rather than cutting out a range. * It only encodes values up to 62 bits long. So, some similarities but also some differences. [1]: https://www.rfc-editor.org/rfc/rfc9000.html#name-variable-length-integer-enc https://www.rfc-editor.org/rfc/rfc9000.html#name-variable-le...
- apitman 4mo agoPerfect, thanks!