Expand description
§bbse — Backward Binary Search Encoding
A minimal and deterministic encoding scheme for any sorted range, based on walking the binary search path to a target value.
Useful in scenarios requiring:
- compact, prefix-free representation of integers from a range;
- simple and reversible encoding for sorted domains;
- constant-time decoding without full table reconstruction (unlike Elias/Fano).
§Example
use bbse::{encode, decode};
let path = bbse::encode(0, 16, 5); // binary search path to 5 in [0..16)
let value = bbse::decode(0, 16, &path); // == 5
assert_eq!(value, 5);