Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorting #61

Open
jimmywarting opened this issue Dec 4, 2022 · 2 comments
Open

sorting #61

jimmywarting opened this issue Dec 4, 2022 · 2 comments

Comments

@jimmywarting
Copy link
Contributor

I'm required to be quite strict and follow this rule:
https://cbor-wg.github.io/CBORbis/draft-ietf-cbor-7049bis.html#section-4.2.1-2.3.1

if i don't then my program complains that my cbor data is invalid...

@atomictag
Copy link

maybe related to #49 (although I am more concerned about records than plain maps, the mechanics and motivations are the same)

@kriszyp
Copy link
Owner

kriszyp commented Dec 5, 2022

I think this would be best done outside of the core cbor-x encoder (like #49). Since JavaScript objects are ordered, rearranging properties is incompatible with correct preservation of object state (which is already a deterministic encoding). But, of course, if we had a separate module that created new JS objects/maps that had been explicitly re-ordered to match the "deterministic encoding" requirement of this spec (that is clearly intended for unordered maps), that would be the best way to match this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants