Skip to content

Cbor{Reader, Writer} should support RFC 8949 determinism #92068

Open

Description

RFC 8949 obsoletes RFC 7049, and the latter is what System.Formats.Cbor is built from.

The revised RFC changes, subtly, the sorting of map keys. The new RFC uses lexicographic sorting, as noted in section 4.2.1.

Section 4.2.3 goes on to say:

The core deterministic encoding requirements (Section 4.2.1) sort map keys in a different order from the one suggested by Section 3.9 of [RFC7049] (called "Canonical CBOR" there). Protocols that need to be compatible with the order specified in [RFC7049] can instead be specified in terms of this specification's "length-first core deterministic encoding requirements"

I would propose a new CborConformanceMode called Rfc8949Deterministic. The new RFC tries to avoid the word "canonical" and instead use "deterministic", which is reflected in the suggested mode's name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions