I'm working with a process that returns raw binary data in the form of a Uint8Array, representing two unsigned 32-bit numbers (Uint32)...
When I log this data to the browser console:
data: Uint8Array(8) [1, 0, 0, 0, 2, 0, 0, 0]
These values correspond to two unsigned 32 bit numbers (4 bytes each)
My question is, how can I convert this binary data into JavaScript numbers?
I attempted using Uint32Array.from(x), but it resulted in an array of 8 numbers, which is incorrect.
The desired output should be an array containing just the two numbers - first 4 bytes -> 1, next 4 bytes -> 2.