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

Bump fxamacker/cbor to 2.x #2635

Closed
kostko opened this issue Feb 3, 2020 · 3 comments · Fixed by #2729
Closed

Bump fxamacker/cbor to 2.x #2635

kostko opened this issue Feb 3, 2020 · 3 comments · Fixed by #2729
Assignees
Labels
c:common Category: common libraries c:deps Category: external dependencies

Comments

@kostko
Copy link
Member

kostko commented Feb 3, 2020

The recently made some minor API changes which should be easy to integrate. The release also brings performance and memory use improvements.

Next release (v2.1) will also add support for CBOR tags which may be useful.

@kostko kostko added c:common Category: common libraries c:deps Category: external dependencies labels Feb 3, 2020
@fxamacker
Copy link

Hi @kostko! I released v2.2 with a bugfix and additional security-related settings: MaxNestedLevels, MaxArrayElements, MaxKeyPairs, IndefLength (allow/forbid), and TagsMd (allow/forbid).

v2.2 also added CBOR byte string <--> Go byte array was added (slice was already supported.)

v2.2 is slightly faster than v2.1, but biggest gains came from v2.1 -- struct using keyasint tag (like COSE and CWT) is about 24-28% faster and 53-61% fewer allocs compared to v1.x and 2.0.

v2.1 added CBOR tags and option to detect duplicate map keys.

Please let me know if I can help!

@kostko
Copy link
Member Author

kostko commented Feb 25, 2020

Cool, we'll bump to v2 soon. I just filed fxamacker/cbor#178, @fxamacker what do you think about adding an option for stricter decoding?

@fxamacker
Copy link

Option(s) for stricter decoding is coming but I need to be cautious because "strict mode" and even the word "strict" is gone in the draft 7049bis.

I want to provide preset options for deterministic encoding/decoding that round trips without violating RFC 7049 and newer 7049bis. This would require stricter decoding.

BTW, 7049bis is moving away from using the word "canonical". It prefers bytewise-lexicographic sort instead of length-first sort (RFC 7049 canonical). I heard 7049bis might get approved "later this year".

https://tools.ietf.org/id/draft-ietf-cbor-7049bis-12.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:common Category: common libraries c:deps Category: external dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants