Module canonical

Source
Expand description

Canonical JSON serialization (simplified RFC 8785).

We don’t implement the full RFC 8785 (which covers numeric edge cases); instead we sort object keys deterministically and emit the same shape as serde_json::to_vec. This is sufficient for hash-chain inputs where the producer and verifier are both Rust processes.

Functions§

canonical_json
Serialize value as canonical JSON: object keys sorted lexicographically.
write_canonical_value
Write a Value as canonical JSON into a Write.