💎 Bijou
Planted
Tended
Bijective variable-length encodings for unsigned integers.
Pronounced "bee-zoo-sixty-four" (bijective offset u64).
bijou is a family of canonical, length-prefixed varints with the property that every value has exactly one encoding, and every encoding decodes to exactly one value. The tag byte alone determines the total length, payloads are big-endian (so lexicographic byte order matches numeric order), and there is no std requirement.
You can read more about the motivation and whatnot in the blog post.
To cherry pick a benchmark (lower is better):
Links
- Blog Post (on the Ink & Switch website)
- GitHub Repo
- Hacker News has a thread
- Lobste.rs also has a thread
Crates
NPM (Wasm)
(Uses wasm-bodge for packaging)
Other Known Implementations
| Implementation | Language | Notes |
|---|---|---|
| LostKobrakai/bijou64 | Elixir | bijou64 port (published on Hex) |
| MichaelMure/go-bijou | Go | bijou64 port |
| scottchiefbaker/perl-Encode-Bijou64 | Perl | bijou64 (on CPAN) |
| Joel-hanson/bijou64 | Java (+ Rust JNI) | bijou64 Kafka serializer/deserializer |