Apex › Data & encoding

Elias γ/δ coding

Parameter-free, self-delimiting codes for positive integers: write a number in binary so a decoder knows where it ends with no separator and no fixed width. γ prefixes the value with ⌊log2 n⌋ zeros as a unary length; δ encodes that length with γ itself, winning for larger numbers. Type a number to see it decompose, then feed a list of gaps and compare against fixed-width.

More in Data & encoding