Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lexicographically canonical JSON form of "Readium webpub manifest" #28

Open
danielweck opened this issue Aug 20, 2018 · 2 comments
Open

Comments

@danielweck
Copy link
Member Author

danielweck commented Aug 20, 2018

Note that there are several "competing" proposals for various definitions of "canonical" JSON, e.g.

https://github.com/gibson042/canonicaljson-spec
https://github.com/gibson042/canonicaljson-go

http://wiki.laptop.org/go/Canonical_JSON
https://github.com/well-typed/canonical-json

https://github.com/mirkokiefer/canonical-json
https://github.com/davidchambers/CANON

https://keybase.io/docs/api/1.0/canonical_packings#json

https://bigeasy.github.io/keyify/docco/keyify.js.html
https://github.com/bigeasy/keyify

...as exemplified by this expansive discussion thread:
https://esdiscuss.org/topic/json-canonicalize
https://mail.mozilla.org/pipermail/es-discuss/2018-March/thread.html#50334

However, in our limited use-case we would in fact not have to deal with sophisticated normalization of unicode strings (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize ) and/or number types, mostly just removal of insignificant whitespace in the serialized representation ("stringify-ed" JSON), and sorting of object properties / keys as per their lexicographic (alphabetical) order.

@danielweck
Copy link
Member Author

Also see improved JSON "stringify" solutions:
https://github.com/epoberezkin/fast-json-stable-stringify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant