Expand description
canonical — canonical-serialization.md reference implementation.
Three primitives:
py_float_repr(n): CPython repr(float) byte-identical decimal.canonical_value(v): key identity (top-level keys sorted only).canonical_json(v): fingerprint (all levels key-sorted; arrays keep order).
Object-key sort is Unicode code-point order across all languages. Rust
str Ord is UTF-8 byte order which equals code-point order, so sort() on
&str/String is the normative comparator (verified by the astral vector).
Structs§
Enums§
Functions§
- canonical_
json - Fingerprint canonical serialization: all object levels code-point key-sorted; arrays keep order.
- canonical_
value - Key-identity canonical serialization: only the top-level object’s keys are code-point sorted; nested values keep insertion order.
- py_
float_ repr - Render
fexactly as CPythonrepr(float)/json.dumps(float)would. Finite floats only; NaN/±Inf return a Failure.