You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is your use-case and why do you need this feature?
Current dev branch supports everything required to get COSE/CWT working, but still requires manual sorting of keys (i.e. declaring properties in the correct order).
It would be beneficial if automatic sorting could be triggered with a configuration switch on the CBOR serializer.
Describe the solution you'd like
Ideally, a two-pass serialization strategy should be an optional possibility: First everything is serialized into a tress structure, then sorted, and finally written out.
I am imagining a two-pass solution, because sorting needs to happen after all keys have been transformed into their CBOR-representation. Hence, the order can only be known once all keys are serialized, because sorting happens on serialized keys.
This can still happen somewhat in-place while writing out data during serialization, but some tree-like structure will still be required to shuffle properties around, so directly writing to an output is not an option. Based on what the code currently looks like, I think this should be possible to implement alongside the current encoder (to avoid slowdown, if you don't require auto-sorting) without duplicating code, but with some refactoring.
I can look into that myself, but I'd like to collect feedback first, so that the general strategy is at least somewhat deemed sensible before implementation starts. I'm hesitant to have this one assigned to me right away, because I don't know when I'll get to it. @whyoleg@sandwwraith I'd very much appreciate any thoughts from your side, as your feedback when pushing basic COSE support upstream was invaluable! Of course, I'd also appreciate feedback from anyone, who knows a thing about two about efficient encoding 😃
The text was updated successfully, but these errors were encountered:
What is your use-case and why do you need this feature?
Current
dev
branch supports everything required to get COSE/CWT working, but still requires manual sorting of keys (i.e. declaring properties in the correct order).It would be beneficial if automatic sorting could be triggered with a configuration switch on the CBOR serializer.
Describe the solution you'd like
Ideally, a two-pass serialization strategy should be an optional possibility: First everything is serialized into a tress structure, then sorted, and finally written out.
I am imagining a two-pass solution, because sorting needs to happen after all keys have been transformed into their CBOR-representation. Hence, the order can only be known once all keys are serialized, because sorting happens on serialized keys.
This can still happen somewhat in-place while writing out data during serialization, but some tree-like structure will still be required to shuffle properties around, so directly writing to an output is not an option. Based on what the code currently looks like, I think this should be possible to implement alongside the current encoder (to avoid slowdown, if you don't require auto-sorting) without duplicating code, but with some refactoring.
I can look into that myself, but I'd like to collect feedback first, so that the general strategy is at least somewhat deemed sensible before implementation starts. I'm hesitant to have this one assigned to me right away, because I don't know when I'll get to it. @whyoleg @sandwwraith I'd very much appreciate any thoughts from your side, as your feedback when pushing basic COSE support upstream was invaluable! Of course, I'd also appreciate feedback from anyone, who knows a thing about two about efficient encoding 😃
The text was updated successfully, but these errors were encountered: