2 ms·
Surely you could lay out a canonical form for JSON in like five minutes? Oh, here: https://www.rfc-editor.org/rfc/rfc8785 https://www.rfc-editor.org/rfc/rfc878
by Dylan16807 4y ago
Surely you could lay out a canonical form for JSON in like five minutes?
Oh, here: https://www.rfc-editor.org/rfc/rfc8785 https://www.rfc-editor.org/rfc/rfc8785
No duplicates, no whitespace, sort the keys, copy number serialization from javascript, a couple other little details.
- tokinonagare 4y ago> Published:June 2020 This only two years old while JSON is in common usage for more than a decade... Without a spec there's dozen way to achieve it, for example by sorting keys using UTF-8 instead of UTF-16 values like done in this document, and the slightest difference would break things when used with crypto.
- Dylan16807 4y agoIf you're doing something cryptographic you need a spec for that anyway, so the extra work to specifying something like json sort order doesn't seem like it's a major factor to me.
- tokinonagare 4y agoThere's a spec for that already for XML: Signed XML. And the tooling that supports it, for instance on the .NET platform. So no need to create yet another spec and tools.
- Dylan16807 4y agoCool, then that spec is more useful than the one I was replying about.