Re:"YOLO" is not a valid hash construction
by magicalhippo on Saturday August 24, 2024 @06:50PM
(#41342462)
XML has a complex solution for this, canonicalization[1], to enable signed XMLs[2]. Seems some folks are trying the same with JSON[3].
[1]: https://en.wikipedia.org/wiki/Canonical_XML
Re:"YOLO" is not a valid hash construction
by justincormack on Sunday August 25, 2024 @07:39AM
(#41346536)
There are a few canonical json specs but they are different and in my experience the implementations are not correct.
If you want a unique hash (like, for a hash table lookup) then you'll need to sort the keys of every object and use a particular implementation of JSON.stringify.
(Also, what do you mean by "you don't even need any separator?")