valpackett / SwiftCBOR

A CBOR implementation for Swift
The Unlicense
132 stars 74 forks source link

Preferred serialization/Deterministic encoding #104

Open cyberphone opened 1 month ago

cyberphone commented 1 month ago

Hello, You mention using https://cbor.me as a reference.

It is possible that I haven't studied your code thoroughly, but it appears that you don't perform "Preferred Serialization" or "Deterministic Encoding". This may be a future request since it is currently in the IETF for standardization: https://datatracker.ietf.org/doc/draft-ietf-cbor-cde/

I have implemented this for JavaScript: https://github.com/cyberphone/CBOR.js#cborjs

mikekelly commented 1 month ago

It's funny you should mention this. I just ran into this problem using SwiftCBOR - it was inconsistently serializing maps which was causing problems with a message signing protocol.