MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / adler32

Function adler32

packages/plugins/apps/src/git-client/packfile.ts:267–275  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

265}
266
267function adler32(bytes: Uint8Array): number {
268 let a = 1;
269 let b = 0;
270 for (const byte of bytes) {
271 a = (a + byte) % 65521;
272 b = (b + a) % 65521;
273 }
274 return (b * 65536 + a) >>> 0;
275}
276
277// zlib wrapper: 2-byte header, deflate, 4-byte adler32. Return inflated + end offset.
278function inflateZlib(

Callers 1

inflateZlibFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected