-
Notifications
You must be signed in to change notification settings - Fork 169
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
Support JSON Canonical Scheme (JCS) - RFC 8785 #167
Comments
The string encoding should be as defined in the RFC if you use the The 3rd point would likely be best handled by a pre-pass that encodes map into a There's some complexity, though, with custom protocol implementations and Either way, I'm not sure it would be possible to support this in a robust way given the way the encoding protocol works. |
@pzingg Why not try getting this in? |
In order to implement Data Integrity Proofs for linked data, Elixir should have a fast JSON encoder that compiles with RFC 8785.
I think there are only few tricky points:
1 [ ]. Encoded string keys and values must be escaped by the RFC's section 3.2.2.2.. This may already be happening in Jason.
2 [x]. Floats must be encoded per the Ryu algorithm according to the RFC's section 3.2.2.3.. I think Jason now handles this for OTP > 25 with the
[:short]
option for in:erlang.float_to_binary/2
.3 [ ]. Encoded objects (recursively and when found in arrays) must have their properties sorted in UTF-16 integer order per the RFC's section 3.2.3
The text was updated successfully, but these errors were encountered: