compress-json-rs
AI-driven Rust port of the JavaScript compress-json library by Beenotung. Store JSON data in a space-efficient compressed form with lossless round-trip compression and decompression.
Features
- Supports all JSON types: objects, arrays, strings, numbers, booleans, and null
- Deduplicates repeated values and keys for optimal size
- Encodes numbers in compact base-62 format
- Zero-copy round-trip using
serde_json::Value
- Fast in-memory compression; no disk or network dependencies
Installation
Add to your Cargo.toml
:
[]
= "0.1.0"
= { = "1.0", = ["derive"] }
= "1.0"
Quick Start
use ;
use ;
API Reference
/// Compressed representation: (values array, root key)
pub type Compressed = ;
/// Compress a JSON value into its compressed form
;
/// Decompress a compressed form back into JSON
;
See docs.rs
for full lower-level API details.
License
Licensed under the BSD-2-Clause license. See LICENSE for details.