I am reading buffers using the Node.js buffer native API. This API has two functions called readUIntBE and readUIntLE for Big Endian and Little Endian respectively.
https://nodejs.org/api/buffer.html#buffer_buf_readuintbe_offset_bytelength_noassert
By reading the docs, I stumbled upon the following lines:
If I understand correctly, this means that I can only read 6 bytes at a time using this function, which makes it useless for my use case, as I need to read a timestamp comprised of 8 bytes.
The byteLength corresponds to e.g. 8bit, 16bit, 24bit, 32bit, 40bit and 48bit. More is not possible since JS numbers are only safe up to Number.MAX_SAFE_INTEGER.
If you want to read 8 bytes, you can read multiple entries by adding the offset.
Please always open issues like these in the https://github.com/nodejs/help repo.
I mean, it is worth pointing out that BigInt support is coming up and there鈥檚 a good chance we鈥檒l be adding support to it in Buffer methods.
I鈥檇 be okay with re-opening this as a feature request for that.
I'd prefer a new issue rather than reopening one that's a feature request hidden behind a question.
(The feature itself I'm a-okay with.)
Thank you all for the quick responses.
I genuinely thought this was a typo in the documentation, thus the reason I posted here first. Next time I will post in the link you have mention and only then, after a confirmation and if the need arises, will I post here.
I would also definitely enjoy this as a new feature, when the time comes.