Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

This reminds me of the varint encoding used by QUIC, but I've never implemented it. Anyone know the differences?


Similar, 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-le...


Perfect, thanks!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: