The same also happens when I call cbor.encodeCanonical()
But in canonical mode I would generally expect the "2" being appended only for actual big numbers (i.e. beyond MAX_INT64), otherwise that isn't really a canonical encoding of numbers, but maybe I'm missing something
Could you clarify if the behavior described above is expected and if so, why?
Ok, I was testing that on https://npm.runkit.com/cbor and for some reason it loads v5.2.0 of the library, on the newest 7.0.4 version it doesn't happen, sorry for the false alarm
Not sure if this is intended but looking at the source it seems to me that in canonical mode, big integers should not have the "2" tag prepended:
http://hildjj.github.io/node-cbor/encoder.js.html#line124
When I do:
I get:
However, when I do:
I get:
The same also happens when I call
cbor.encodeCanonical()
But in canonical mode I would generally expect the "2" being appended only for actual big numbers (i.e. beyond MAX_INT64), otherwise that isn't really a canonical encoding of numbers, but maybe I'm missing something
Could you clarify if the behavior described above is expected and if so, why?