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
13
14
use json_packer::{compress_to_bytes, CompressOptions};
use serde_json::json;

#[test]
fn deterministic_output_same_input() {
    let v = json!({
        "name": "Alice",
        "age": 30,
        "profile": {"name": "Alice"}
    });
    let a = compress_to_bytes(&v, &CompressOptions::default()).unwrap();
    let b = compress_to_bytes(&v, &CompressOptions::default()).unwrap();
    assert_eq!(a, b);
}