Closed ThomasJRyan closed 2 years ago
e13970fc2c31bc7b97133607c525cd5fe1fec86b adds support for reading/writing big-endian.
Added the following data types:
INT16_BE
- 2 bytesUINT16_BE
- 2 bytesSHORT_BE
- 2 bytesUSHORT_BE
- 2 bytesLONG_BE
- 4 bytesULONG_BE
- 4 bytesINT_BE
- 4 bytesUINT_BE
- 4 bytesINT32_BE
- 4 bytesUINT32_BE
- 4 bytesINT64_BE
- 8 bytesUINT64_BE
- 8 bytesFLOAT_BE
- 4 bytesDOUBLE_BE
- 8 bytesWhen one of these types is specified, the library will do one of the following:
For memoryjs.INT64_BE
and memoryjs.UINT64_BE
types, a BigInt needs to be passed or an error will be thrown. At some point I will also require the little endian types (memoryjs.INT64
, memoryjs.UINT64
) to be of type BigInt too.
This change probably won't be published to NPM for a while (need to add/overhaul testing), so I'll leave the issue open for a bit and close it if there are no further comments.
Holy. Did not expect this to actually get addressed. Huge thanks Rob!
No problem @ThomasJRyan , thanks for the feature request!
I'm not sure if this is even possible given the underlying architecture, but I was wondering if there is any chance of support for little endian reading and writing of memory? I feel like for it to be feasible there would need to be an extra layer written on top to convert the existing big endian memory into little endian