-
Notifications
You must be signed in to change notification settings - Fork 148
Closed
Description
I was trying to cryptographically sign some BSON documents using the dryoc
crate, and noticed that, sometimes my tests would pass, other times they would somehow fail!? And when I made some seemingly random changes to the code, it would start working again!?
It turns out the root cause was that, when I was serializing the same data, it was not always in the same order, causing the signature to be different! ๐ฎ
I guess that's on me for trying this with an unstructured data format, but it would be nice to have a feature that automatically sorts entries. I currently hacked together a to_sorted
function that sorts the entries using &str
's handy built-in Cmp
.
Metadata
Metadata
Assignees
Labels
No labels