MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / crc32

Function crc32

packages/node-runtime/src/import/archive/test-utils.ts:19–25  ·  view source on GitHub ↗
(buffer: Buffer)

Source from the content-addressed store, hash-verified

17}
18
19function crc32(buffer: Buffer): number {
20 let crc = 0xffffffff
21 for (const byte of buffer) {
22 crc = CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >>> 8)
23 }
24 return (crc ^ 0xffffffff) >>> 0
25}
26
27/**
28 * 测试专用的最小 ZIP 生成器,仅实现 UTF-8 文件名和 deflate,

Callers 1

writeZipFixtureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected