Expand description
Canonical JSON serialization per SPEC §5.
Given a serde_json::Value, produce the canonical byte sequence that
is the input to SHA-256 content addressing (§6). Rules:
- Object keys sorted by NFC-normalized UTF-8 bytes (§5.1).
- No whitespace between tokens (§5.1).
- Strings NFC-normalized before emission (§5.2).
- Numbers in shortest round-trip decimal form (§5.3).
-0normalizes to0(§5.3).
Functions§
- to_
bytes - Serialize a
serde_json::Valueto canonical bytes (SPEC §5).