Skip to main content

Module canonical

Module canonical 

Source
Expand description

Canonical JSON: recursively sorted object keys, compact separators, UTF-8, no trailing newline, integers only.

This matches the Cognitum ADR-154 canonical form (json.dumps(sort_keys= True, separators=(",", ":"), ensure_ascii=False)) for the value space both sides accept, and is independent of whether serde_json was built with preserve_order. Floats are refused so that two runtimes can never disagree about number formatting.

Enums§

CanonicalError
Reasons a value has no canonical encoding.

Constants§

MAX_CANONICAL_BYTES
Upper bound on canonical output size.

Functions§

canonical_json
Encode value canonically.