shamblett / cbor

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

Split _CborListImpl into _CborDefiniteLengthListImpl and _CborIndefiniteLengthListImpl #51

Closed AlexDochioiu closed 1 year ago

AlexDochioiu commented 1 year ago

Hello,

I would like to add an option to explicitly define definite/indefinite list length and also to maintain this context when parsing CBOR.

Context: I am performing cryptographic operations and hashing on CBOR data. The fact that HexEncodedCbor -> CborValue -> HexEncodedCbor yields a different result compared to the input is causing me problems and making stuff harder to test. Also I often need to make additive changes to CBOR. But doing this and re-encoding the CBOR turns some indefinite lists into a definite lists.

P.S. I am happy to help with this work. I just wanted to know whether you would accept merging a PR for it. Otherwise I'd just fork this and maintain a separate copy myself.

shamblett commented 1 year ago

Hi, yes I will look at any PR's for this you might want to raise, sorry for the late reply here.

shamblett commented 1 year ago

Complete, package re published at version 6.1.0

AlexDochioiu commented 1 year ago

Awesome!