• By truncating you mean producing an 8 bit number - turning 5000 into 136, rather than 19 and 136?

    I think so - E.toX takes whatever you give it, and should produce something with the same number of elements. I think if you did:

    a = new Uint16Array(4);
    a[1] = 4;
    b = E.toUint8Array(a);
    console.log(b[1]);
    

    You'd expect to get 4 returned.

    As you found, if you want to get at the untruncated byte data of a UintXArray, you can just access array.buffer

About

Avatar for Gordon @Gordon started