
Library for numeric level (de)compacting of objects based on a schema. Iteration on my experience with url-safe-bitpacking, aiming for a nicer developer experience, more performance and more scalable data types.
The key technical differences to url-safe-bitpacking is that reading and writing of data is done through a big-int intermediary. For programming purposes: a shape can be defined once as a template and referenced from anywhere, even from within itself, allowing for arbitrary AST definitions. Numeric ranges can be shared in the same way, with presets (say mm and m) of which every payload picks one.
Since 0.4 the schema itself can also be packed into a string, rather shorter than its JSON. The biggest trade-off of url-safe-bitpacking, namely that without the object definition the state is illegible, can therefore be sidestepped by just sending the definition along.
Visual schema builder for the library. A schema is put together as a tree and every field shows what it costs in bits. The ribbon on top shows every bit the preview data encodes to, grouped by the character it ends up in.
No backend used at all! Schema and preview data are both stored in the link, feel free to share one with a friend.
The projects below all keep their state in the url. SVG SDF is the first one running on densing, most of the others still rely on url-safe-bitpacking.
url-safe-bitpacking, and State to Function, the POC to store simple math in a url.