Line 264:
//if (decoder.offset !== buffer.length) throw new Error((buffer.length - deco\
der.offset) + " trailing bytes");
Prevents larger buffer containing a shorter msgpack content to be decoded (I commented it out).
My situation is the following: I use a block Ciphering methods to transmit data (with LoRa). Buffers are then multiple of 16, and my msg has trailing 0. I cannot remove those trailing 0 (it could be part of the msgpacked content).
I'm using msgpack.js with node-red-node-msgpack.
A workaround would be to send also mspack length in the message, that would be in contradiction with the "as short as possible" characteristic of msgpack. And I think a msgpack message in a larger buffer has to be considered as valid.
Line 264: //if (decoder.offset !== buffer.length) throw new Error((buffer.length - deco\ der.offset) + " trailing bytes");
Prevents larger buffer containing a shorter msgpack content to be decoded (I commented it out).
My situation is the following: I use a block Ciphering methods to transmit data (with LoRa). Buffers are then multiple of 16, and my msg has trailing 0. I cannot remove those trailing 0 (it could be part of the msgpacked content). I'm using msgpack.js with node-red-node-msgpack.
A workaround would be to send also mspack length in the message, that would be in contradiction with the "as short as possible" characteristic of msgpack. And I think a msgpack message in a larger buffer has to be considered as valid.
Regards, Ph.R.