Bbor62 – A compact binary-to-text compressor

2 beligum 1 8/1/2025, 10:36:49 AM github.com ↗

Comments (1)

beligum · 7h ago
Since long, I've wanted to invent a general-purpose binary encoder with the following properties:

- bidirectional client/server: encoder and decoder in both Java and Javascript (and others?) - schemaless: no protobuf or avro, just plug-and-play - streaming: no analysis, single pass only - pure alphanumeric: [0-9][a-z][A-Z] and nothing else, so resulting strings are 'pretty' and double-click/long-tap selection works as expected - balanced implementation complexity, size and compression ratio - no padding/trailing characters - support for UTF-16 - no dependencies!

This project started out as a study of Pieroxy's lz-string compressor. LZ-string is quite good, but doesn't meet my goals. I needed something better, especially for JSON payloads. I ended up implementing my own encoder as a combination of CBOR + LZW + base62.

BBOR62 is efficient, portable and URL-safe.