shamblett / cbor

A CBOR implementation for Dart
MIT License
36 stars 16 forks source link

(issue28) Update API to RFC 8949 #36

Closed nicbn closed 2 years ago

nicbn commented 2 years ago

This updates the API to RFC8949.

In particular, strict mode has been removed. Now the decoder will throw if not well-formed inputs are found, and invalid inputs are accepted but will throw when parsed by the user.

One exception is that the decoder will not throw if the concatenation of a indefinite length string is valid but the individual strings are not. This is out of spec, but should not cause any problems as it will just accept some not well-formed inputs.

The equality implementation now properly verifies all tags.

Also the internal "Info" has been renamed to "Arg", as it is called argument in the RFC.

shamblett commented 2 years ago

Great, kills two birds with one stone, API rewrite and update to the latest spec.

Please add an AUTHORS file with your details in future PR's if you wish.