79263453

Date: 2024-12-08 22:27:43
Score: 0.5
Natty:
Report link

As noted by @Botje in a comment, the issue was with the construction of the Uint8Array, where the source was continually being overwritten at the beginning, and the rest of the array was empty.

So instead of:

  for (const x of arrayOfUInt8Array) {
    uInt8Array.set(x);
  }

I needed:

  let i = 0;
  let currentIndex = 0;
  for (const x of arrayOfUInt8Array) {
    uInt8Array.set(x, currentIndex)
    currentIndex += arrayOfUInt8Array[i].length
    i += 1
  }
Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • User mentioned (1): @Botje
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: Ben