hildjj / node-cbor

Encode and decode CBOR documents, with both easy mode, streaming mode, and SAX-style evented mode.
MIT License
357 stars 73 forks source link

encode as array(*) and primitive #112

Closed ashisherc closed 4 years ago

ashisherc commented 4 years ago

I wanted to encode some data as array(*) when the array length is more then certain limit, this is how a data Im parsing has encoded, when I decode the data and encode back, I get a different cbor hash,

@hildjj can you please help what can be done here, is there a way I can just traverse the cbor without decoding and create a hash out of the certain part of a cbor?

hildjj commented 4 years ago

For encoding, see #107. Another approach would be to use the eventing system that Decoder has in order to see the raw bytes. See commented.js for an example.

ashisherc commented 4 years ago

continued here, https://github.com/hildjj/node-cbor/issues/107