(buffers: Uint8Array[])
| 127 | } |
| 128 | |
| 129 | function concatBuffers(buffers: Uint8Array[]): Uint8Array { |
| 130 | const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); |
| 131 | |
| 132 | const merged = new Uint8Array(totalLength); |
| 133 | let offset = 0; |
| 134 | for (const buffer of buffers) { |
| 135 | merged.set(buffer, offset); |
| 136 | offset += buffer.length; |
| 137 | } |
| 138 | |
| 139 | return merged; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Parses an envelope |
no test coverage detected