Deterministic encoding
05A protocol can require one chosen serialization among several valid encodings.
For core deterministic encoding, key 100 (18 64) precedes key −1 (20), because 18 < 20 in hex. Keep each value paired with its key. Length-first ordering is a different profile (§4.2.3).
Key idea: Core deterministic encoding uses preferred shortest representations.
Rules & examples
Core deterministic encoding uses preferred shortest representations.
- Core deterministic encoding uses preferred shortest representations.
- It disallows indefinite-length items and orders map keys by their deterministic encoded byte order.
- Determinism does not itself provide signatures, schemas, or semantic validity.
Examples are illustrative. Consult the linked RFC and its errata for implementation details.
Sources
New to this? Start hereA quick picture + helpful background
First, agree how to read the message.
An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.