Bijou64: A variable-length integer encoding

An accidentally fast variable-length integer encoding

AI Summary

The article describes bijou64, a variable-length integer encoding developed for the Subduction CRDT sync protocol that unexpectedly outperforms more common encodings like LEB128. The encoding was designed to ensure each number has only one valid representation to fix a signature-verification bug, and this canonical constraint inadvertently made it faster by requiring less computational work during decoding. Unlike LEB128, which allows multiple ways to encode the same number and requires runtime checks to enforce correctness, bijou64's structure inherently prevents non-canonical encodings.

Read Original → · Discuss with AI → · Share →
← Back to news