---
title: "bijou64"
url: https://daily.dev/posts/bijou64-zxaybgiy5
source_url: https://www.inkandswitch.com/tangents/bijou64
type: article
source: "Lobsters"
published: 2026-05-29T18:23:55.482Z
updated: 2026-05-29T18:24:21.930Z
tags: ["rust"]
reading_time: 10
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# bijou64

**[Lobsters](https://daily.dev/sources/lobsters)** · 10 min read · 1 upvotes · 0 comments

## Summary

bijou64 is a variable-length integer (varint) encoding developed for a CRDT sync protocol, designed to be canonical by construction — meaning each integer has exactly one valid byte representation, eliminating a class of signature-verification bugs without runtime canonicality checks. Unlike LEB128, which uses continuation bits and allows multiple encodings for the same value, bijou64 uses a first-byte tag to signal total length and applies offsets to guarantee uniqueness. Benchmarks on ARM (M2 Pro) and x86 (Zen 5) show bijou64 decodes 2–10x faster than LEB128, largely because the decoder knows the byte count immediately from the first byte, avoids continuation-bit scanning, and works with contiguous big-endian payloads that map well to CPU byte-swap instructions. The library is published on crates.io (dual MIT/Apache-2.0) with a Wasm/JS wrapper available.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.inkandswitch.com/tangents/bijou64>

## Similar posts on daily.dev

- [Ink & Switch Introduces Bijou64: Canonical Variable-Length Integer Encoding for Safe Parsing](https://daily.dev/posts/ink-switch-introduces-bijou64-canonical-variable-length-integer-encoding-for-safe-parsing-mgtcxowck) · InfoQ · 0 upvotes · 0 comments
- [Replacing a Rust Enum with a 64-bit Word Made My Interpreter 17% Faster](https://daily.dev/posts/replacing-a-rust-enum-with-a-64-bit-word-made-my-interpreter-17-faster-vl1pbon5a) · Pointers Gone Wild · 0 upvotes · 0 comments
- [Simple batch decoding of unary codes](https://daily.dev/posts/simple-batch-decoding-of-unary-codes-kyuqotiln) · Ryg blog · 0 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/bijou64-zxaybgiy5)
