Giter VIP home page Giter VIP logo

Comments (6)

laurencelundblade avatar laurencelundblade commented on June 20, 2024

Hi Brian,

Maybe take a look at #117? I know it is not working, but I think it might do what you want. If it does, I might get back to work on it soon. Had another similar request a few days ago too.

Offsets might be workable if it is only to Tell() and pulling out ranges, but Seek() is a very different matter because that means recomputing the internal nesting tracking state, which is complicated. You only want Tell(), right?

from qcbor.

BrianSipos avatar BrianSipos commented on June 20, 2024

Yes, just exposing a Tell interface with an appropriate explanation of what the offset represents (the position of the start of the next item, break, or EOF depending on what's already been decoded) is enough to be able to use the offset to extract encoded bytes from the original data. A simple Tell would allow the user to decide whether to extract one item, a sequence, etc.

from qcbor.

BrianSipos avatar BrianSipos commented on June 20, 2024

Having a Tell interface for the streaming encoder would also be valuable for certain uses. Specifically, there are CRC byte-string items as part of RFC 9171 block encodings that would be useful to manipulate in-place after encoding a placeholder (zero values) byte-string.
Having similar encoder Tell function would allow generating CRC values and replacing byte-string contents without needing to re-encode all of the preceding items (because the items haven't changed, only the CRC value).

from qcbor.

laurencelundblade avatar laurencelundblade commented on June 20, 2024

OK. Understood. Seems reasonable and not too hard. Will look at it in the next few weeks ( have a queue of stuff...)

from qcbor.

laurencelundblade avatar laurencelundblade commented on June 20, 2024

Also, create_tbs_hash() in https://github.com/laurencelundblade/t_cose/blob/master/src/t_cose_util.c may be worth a look. It uses incremental hashing to create the hash of a potentially large CBOR structure without duplicating it in memory. Maybe there is a parallel with what you are doing (or maybe not).

Appreciate your request. Helps to make QCBOR better.

from qcbor.

laurencelundblade avatar laurencelundblade commented on June 20, 2024

Fixed by #223

from qcbor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.