ormsgpack icon indicating copy to clipboard operation
ormsgpack copied to clipboard

How canonical is `ormsgpack`?

Open apoorvkh opened this issue 1 year ago • 0 comments

Hi, I was wondering how "canonical" ormsgpack is: i.e. will any two equal objects result in the same serialized bytes?

I found this issue (https://github.com/msgpack/msgpack/issues/215) that says the msgpack specification is not canonical. But I am wondering if the ormsgpack implementation is canonical. (I realize the one edge case is that dictionary elements should be sorted to maintain consistency.)

On the other hand, I see that datetime and dataclass objects serialize to their string or dictionary equivalents. Thus, two objects with different types may serialize to the same bytes. Are there any other cases where that is also true?

Would appreciate some input. Thanks a lot!

apoorvkh avatar Apr 22 '24 21:04 apoorvkh