MCPcopy Create free account
hub / github.com/codedogQBY/ReadAny / dataBlock

Function dataBlock

packages/core/src/utils/umd-parser.test.ts:60–65  ·  view source on GitHub ↗
(dataID: number, content: Uint8Array)

Source from the content-addressed store, hash-verified

58}
59
60function 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
67function buildFixture(): { bytes: Uint8Array; expectedContent: string; coverBytes: Uint8Array } {
68 // Two chapters' content concatenated

Callers 2

buildFixtureFunction · 0.70
umd-parser.test.tsFile · 0.70

Calls 2

concatFunction · 0.70
u32leFunction · 0.70

Tested by

no test coverage detected