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

Function crc32Table

packages/engine/src/utils/alphaBlit.test.ts:33–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32let _crcTable: Uint32Array | undefined;
33function crc32Table(): Uint32Array {
34 if (_crcTable) return _crcTable;
35 const t = new Uint32Array(256);
36 for (let i = 0; i < 256; i++) {
37 let c = i;
38 for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
39 t[i] = c;
40 }
41 _crcTable = t;
42 return t;
43}
44
45function makeChunk(type: string, data: Buffer): Buffer {
46 const typeBuffer = Buffer.from(type, "ascii");

Callers 1

crc32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected