Conversation
|
Hi! WDYT? |
|
Hi! It's an interesting idea, but handling endianness manually might not be practical. Instead, we could consider adding a "magic_number" to determine the endianness. One possible solution could be initializing "seqproto" using the first incoming bytes (the "magic_number") to determine how to proceed. We could follow this approach:
WDYT? |
|
If we go in this direction, it is a breaking change. While we can change the method signatures, I prefer to keep the dump created compatible (i.e., allow the developer to turn off this option). |
Hi, in this PR I removed Uint32Array and replaced it with DataView.
Unfortunately Uint32Array serializes and deserializes data using the byte order of your platform. If the platform sending/receiving the data differs in byte order, the data cannot be read/written correctly.
DataView (in this case) will always and only use the big endian order, guaranteeing compatibility on the various platforms.