streaming zip archiver/extractor jsr.io/@mary/zip
typescript jsr
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix broken CRC #1

open opened by decahedron.pyke.io targeting trunk

CRC calculation was broken on some files (particularly empty ones)

Labels

None yet.

Participants 1
AT URI
at://did:plc:632jymaeddsmjdmilzen3cfc/sh.tangled.repo.pull/3mliedrf5nz22
+3 -3
Diff #0
+3 -3
lib/zip.ts
··· 70 70 crc = CRC32_TABLE[(crc ^ chunk[idx]) & 0xff] ^ (crc >>> 8); 71 71 } 72 72 73 - return crc ^ -1; 73 + return crc; 74 74 } 75 75 76 76 function unixToDosTime(unixTimestamp: number): { time: number; date: number } { ··· 249 249 // 8 - compressed size 250 250 // 12 - uncompressed size 251 251 writeUint32LE(view, 0, 0x08074b50); 252 - writeUint32LE(view, 4, crc); 252 + writeUint32LE(view, 4, ~crc); 253 253 writeUint32LE(view, 8, compressedSize); 254 254 writeUint32LE(view, 12, uncompressedSize); 255 255 ··· 290 290 writeUint16LE(view, 10, method); 291 291 writeUint16LE(view, 12, dosTime); 292 292 writeUint16LE(view, 14, dosDate); 293 - writeUint32LE(view, 16, crc); 293 + writeUint32LE(view, 16, ~crc); 294 294 writeUint32LE(view, 20, compressedSize); 295 295 writeUint32LE(view, 24, uncompressedSize); 296 296 writeUint16LE(view, 28, fnameLen);

History

1 round 0 comments
sign up or login to add to the discussion
patch application failed: error: patch failed: lib/zip.ts:70 error: lib/zip.ts: patch does not apply
expand 0 comments