-
Notifications
You must be signed in to change notification settings - Fork 78
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
Orderd Dictionary/Map #77
Comments
Or are you asking about whether or not you can get SwiftCBOR to produce what the (most recent) CBOR RFC defines as "Deterministic Encoding"? |
Even if we implemented something like the code in #50 you wouldn't necessarily get back a map ordered in the same way as the map was ordered when inserted it, because dictionaries in Swift aren't ordered (but you would get back something deterministic if we merged something like #50). You can write what looks like an ordered map/dictionary but in reality it's not actually ordered. I know Swift know has some extra packages where you can get things like Understanding more about what you're trying to achieve and why would help, if possible. |
Yes, my problem is that I need CBOR Map to be exactly as I define it in my example above because I'm using it for the decryption, and if the keys are not in the same position like I did define them then my decryption doesn't work :( I would say it is more in the way of |
But it could help, because my keys are always |
hi @hamchapman do you have any idea how I could solve it? I tried with #50 but it solves my problem partially because I have a map and inside a map another map and so. |
I've solved it :) it was #50 ... thnx |
You can use my pull request PR 96 |
Hi Folks,
is there any way to get the ordered map back?
return CBOR.map([ 1: "key1", 2: "key2", 3: "key3", 4: "key4", ])
after this, I'm getting a random map each time and need to get ith sorted somehow.
Could you please help me with this?
The text was updated successfully, but these errors were encountered: