(...buffers: Uint8Array[])
| 4 | const MAX_INT32 = 2 ** 32 |
| 5 | |
| 6 | export function concat(...buffers: Uint8Array[]): Uint8Array { |
| 7 | const size = buffers.reduce((acc, { length }) => acc + length, 0) |
| 8 | const buf = new Uint8Array(size) |
| 9 | let i = 0 |
| 10 | for (const buffer of buffers) { |
| 11 | buf.set(buffer, i) |
| 12 | i += buffer.length |
| 13 | } |
| 14 | return buf |
| 15 | } |
| 16 | |
| 17 | function writeUInt32BE(buf: Uint8Array, value: number, offset?: number) { |
| 18 | if (value < 0 || value >= MAX_INT32) { |
no outgoing calls
no test coverage detected
searching dependent graphs…