Skip to content

support for writing zip64 - #562

Merged
cthackers merged 1 commit into
cthackers:masterfrom
mielverkerken:master
Jun 29, 2026
Merged

cthackers merged 1 commit into
cthackers:masterfrom
mielverkerken:master

Conversation

@mielverkerken

Copy link
Copy Markdown
Contributor

Summary

Add ZIP64 footer writing support for archives that exceed classic ZIP end-of-central-directory limits.

Previously, creating an archive with more than 65,535 entries fails while writing the classic EOCD record because entry counts are stored as UInt16 values. This change writes ZIP64 end records when needed and keeps the classic EOCD compatibility record with saturated placeholder values.

Changes

  • Add a writeBigUInt64LE utility alongside the existing ZIP64 read helper.
  • Emit ZIP64 end of central directory record and locator when entry count, central directory size, or central directory offset exceeds classic ZIP limits.
  • Preserve the existing classic EOCD output path for small archives.
  • Ensure ZIP comments are copied to the correct footer position when ZIP64 records are present.
  • Add regression coverage for archives with more than 65,535 entries.

Test Plan

  • npm test

Result: 93 passing

@mielverkerken

Copy link
Copy Markdown
Contributor Author

#320

@cthackers
cthackers merged commit 46279d7 into cthackers:master Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants