Comments (6)
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.
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.
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.
OK. Understood. Seems reasonable and not too hard. Will look at it in the next few weeks ( have a queue of stuff...)
from qcbor.
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.
Fixed by #223
from qcbor.
Related Issues (20)
- Build error if ARM microlib is used HOT 3
- Enhancement: release QCBOR as MDK Software Pack
- How to decode null terminated string? HOT 2
- UsefulBuf.h gives warnings when used with MSVC HOT 4
- ENCRYPTO should be ENCRYPT0 HOT 1
- Need BKM to use CBOR HOT 2
- Writing an empty null buffer triggers undefined behaviour. HOT 2
- Streaming encoding on the fly HOT 4
- CMake should support installation
- How to use cmake's disable float options? HOT 4
- Warnings when building release tag version 1.2 HOT 9
- Backward compatibility is broken HOT 4
- License file/Github setting HOT 2
- QCBOR should have QCBORDecode_SetError() HOT 4
- QCBORDecode_EnterArrayFromMapN should return array item
- QCBOREncode_Finish() should set internal error state HOT 1
- use "encoder-decoder" in documentation HOT 1
- Valid cursor at end-of-input results in same Tell output as error state HOT 1
- Documentation on and example of preferred way to iterate a variable-length array HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qcbor.