MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / makeChunk

Function makeChunk

packages/engine/src/utils/alphaBlit.test.ts:45–50  ·  view source on GitHub ↗
(type: string, data: Buffer)

Source from the content-addressed store, hash-verified

43}
44
45function makeChunk(type: string, data: Buffer): Buffer {
46 const typeBuffer = Buffer.from(type, "ascii");
47 const crcInput = Buffer.concat([typeBuffer, data]);
48 const crcBuf = uint32BE(crc32(crcInput));
49 return Buffer.concat([uint32BE(data.length), typeBuffer, data, crcBuf]);
50}
51
52const PNG_SIG = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
53

Callers 4

makePngFunction · 0.85
makePngWithFilterFunction · 0.85
alphaBlit.test.tsFile · 0.85
makePng16Function · 0.85

Calls 3

uint32BEFunction · 0.85
fromMethod · 0.80
crc32Function · 0.70

Tested by

no test coverage detected