-
Notifications
You must be signed in to change notification settings - Fork 64
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
Canonicalization rfc8949 and rfc7049 implementation for structs #143
base: main
Are you sure you want to change the base?
Conversation
00913bd
to
c5485b2
Compare
Signed-off-by: Liam Gray <[email protected]>
Signed-off-by: Liam Gray <[email protected]>
This PR includes what I believe is working support for both forms of CBOR canonicalisation (RFC 7049 and RFC 8949). It should be implemented in a fairly clean way, and hides the modifications behind a Let me know if you would be interested in this work, before I look to add a number of test cases and clean up any code nits? Thanks! This also renames |
Signed-off-by: Liam Gray <[email protected]>
Update: I have replaced the canonical feature flag in favour of type parameters (see the I felt it was best to leave the commits for each change visible instead of rebasing against main in case you would like to compare the changes. Happy to take any feedback! |
Signed-off-by: Liam Gray <[email protected]>
Signed-off-by: Liam Gray <[email protected]>
Signed-off-by: Liam Gray <[email protected]>
@npmccallum thoughts? |
This is PR a WIP/example regarding rfc8949 4.2.1 canonicalisation. Related issue is: #144
The aim is to ensure all structs or collection types output with rfc8949 canonicalisation. It would also be fairly easy for me to add rfc7049 canonicalisation too, and change the
canonical
argument to an enum.I believe the existing implementation does not output canonical CBOR for structs, while this implementation introduces this as an option.
I'm happy to clean up and finish off this MR, if you're open to including this work?