(...arrays: Uint8Array[])
| 13 | } |
| 14 | |
| 15 | export function concatUint8Arrays(...arrays: Uint8Array[]) { |
| 16 | let totalLength = 0; |
| 17 | |
| 18 | for (const arr of arrays) { |
| 19 | totalLength += arr.length; |
| 20 | } |
| 21 | |
| 22 | const result = new Uint8Array(totalLength); |
| 23 | |
| 24 | let offset = 0; |
| 25 | |
| 26 | for (const arr of arrays) { |
| 27 | result.set(arr, offset); |
| 28 | |
| 29 | offset += arr.length; |
| 30 | } |
| 31 | |
| 32 | return result; |
| 33 | } |
no test coverage detected