(tag: string, payload: Uint8Array)
| 34 | }) |
| 35 | |
| 36 | const backendMessage = (tag: string, payload: Uint8Array): Buffer => { |
| 37 | const length = Buffer.allocUnsafe(4) |
| 38 | length.writeInt32BE(payload.length + 4) |
| 39 | return Buffer.concat([Buffer.from(tag), length, payload]) |
| 40 | } |
| 41 | |
| 42 | const int32 = (value: number): Buffer => { |
| 43 | const bytes = Buffer.allocUnsafe(4) |
no test coverage detected