json-packer 0.1.0

Reversible JSON binary compression/decompression library with Huffman-encoded keys and optional string value pooling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use serde_json::json;
use json_packer::{compress_to_bytes, CompressOptions};

#[test]
fn dictionary_roundtrip_via_public_api() {
    let v = json!({
        "用户": "张三",
        "年龄": 25,
        "🚀": "rocket"
    });
    let _bytes = compress_to_bytes(&v, &CompressOptions::default()).unwrap(); // covers dictionary write path implicitly
}