(dataID: number, content: Uint8Array)
| 58 | } |
| 59 | |
| 60 | function dataBlock(dataID: number, content: Uint8Array): Uint8Array { |
| 61 | // Layout: '$' dataID[4 LE] dataLen[4 LE] content |
| 62 | // dataLen covers full 9-byte header + content |
| 63 | const dataLen = 9 + content.length; |
| 64 | return concat(new Uint8Array([0x24]), u32le(dataID), u32le(dataLen), content); |
| 65 | } |
| 66 | |
| 67 | function buildFixture(): { bytes: Uint8Array; expectedContent: string; coverBytes: Uint8Array } { |
| 68 | // Two chapters' content concatenated |
no test coverage detected