Expand description
JSON Canonicalization Scheme helpers.
Object member ordering and finite floating-point formatting follow RFC
8785. The raw-text API rejects duplicate object member names and malformed
JSON. Integer tokens that serde_json retains exactly as i64 or u64
are additionally rejected outside [-(2^53)+1, (2^53)-1]; integer-valued
binary64 numbers are subject to the same local policy. Non-integer binary64
numbers follow RFC 8785’s ECMAScript rounding semantics.
If dependency feature unification enables serde_json/arbitrary_precision,
the raw-text entry point fails closed with
JcsError::UnsupportedNumberRepresentation. The feature changes the
deserializer’s number visitor contract, so proceeding could produce
noncanonical bytes. Integrators that require that feature should use a
separately compiled JCS lane until an independent tokenizer is available.
Enums§
- JcsError
- Error returned when JSON canonicalization (JCS) fails.
Constants§
- MAX_
NESTING_ DEPTH - Maximum array/object nesting depth accepted by both JCS entry points.
Functions§
- canonicalize_
json_ text - Parse and canonicalize one untrusted JSON text according to RFC 8785.
- canonicalize_
trusted_ json_ value - Canonicalize a trusted, already-materialized JSON value according to RFC 8785 (JSON Canonicalization Scheme).