Home > database >  serialization/deserialization of Node JS "undefined" in other languages
serialization/deserialization of Node JS "undefined" in other languages

Time:12-31

I'm serializing some data using message pack(@msgpack/msgpack) on a Node JS server and passing the serialized data via an HTTP communication to another software that is written in C . My question is, what would a deserialized js "undefined" object look like on the C side?

Thanks in advance

CodePudding user response:

The documentation says undefined and null are mapped to msgpack's nil, which is specified to be a single 0xC0 byte (192 in decimal).

To wit:

> require("@msgpack/msgpack").encode(undefined)
Uint8Array(1) [ 192 ]
  • Related