2 ms·
If it helps, I took the class I made that converts between 4 Uint8Clamped values to a Uint32 value and vice versa into an NPM package at [0]. At the very least
by Klathmon 10y ago
If it helps, I took the class I made that converts between 4 Uint8Clamped values to a Uint32 value and vice versa into an NPM package at [0].
At the very least it can show you some of the gotchas with bit shifting in JS (like how values often look negative until they are placed into a Uint32array then they become positive integers, and how you need to check for endianness)
[0] https://github.com/Klathmon/BitPacker.js https://github.com/Klathmon/BitPacker.js
- vanderZwan 10y agoWould not have thought of checking for endianness, thanks!