MCPcopy Index your code
hub / github.com/codeaashu/claude-code / chunk

Function chunk

src/utils/ansiToPng.ts:292–301  ·  view source on GitHub ↗
(type: string, data: Uint8Array)

Source from the content-addressed store, hash-verified

290}
291
292function chunk(type: string, data: Uint8Array): Buffer {
293 const body = Buffer.alloc(4 + data.length)
294 body.write(type, 0, 'ascii')
295 body.set(data, 4)
296 const out = Buffer.alloc(12 + data.length)
297 out.writeUInt32BE(data.length, 0)
298 body.copy(out, 4)
299 out.writeUInt32BE(crc32(body), 8 + data.length)
300 return out
301}
302
303/**
304 * Encode an RGBA pixel buffer as PNG. Minimal encoder: 8-bit depth,

Callers 1

encodePngFunction · 0.85

Calls 3

crc32Function · 0.85
writeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected