← All updates

Engineering / Field note

Matching files can still produce a different ZIP hash

Matching extracted file contents do not establish that two ZIP archives are identical. Metadata, member order and compression choices matter when a release check promises to reproduce the approved package.

By Zyel · Published · 4 min read

Imagine a hypothetical release check that rebuilds a source download, opens both ZIP files and finds the same filenames with matching file-content digests. The archive checksums still differ. That result can be perfectly consistent: the comparison of extracted contents and the comparison of the complete package cover different bytes.

This November 11, 2026 field note examines established ZIP behavior and its implications for release verification. The examples are hypothetical. Zyel’s interpretation is that a reproducibility claim becomes useful when it names the artifact and the comparison that actually passed.

A ZIP contains more than the file contents

Python’s zipfile documentation describes archive members through ZipInfo objects, including their names and modification times. The module also exposes compression methods and compression levels. An archive therefore represents choices about the stored members as well as their uncompressed contents. [1]

The Reproducible Builds archive guide identifies modification times, member ordering and permissions as sources of variation. Its ZIP discussion also notes extra metadata fields that can contain additional timestamps. [2]

In a hypothetical pair of builds, the text of every source file could stay unchanged while the recorded modification time changes. A reviewer comparing only the filenames and uncompressed bytes would observe matching contents. A reviewer comparing the complete archive would include the changed metadata in that comparison.

Neither observation needs to be hidden. Together they help locate the difference. The release record should preserve the narrower result while acknowledging that the archive itself did not match. Calling both outcomes simply “the same build” would discard the distinction the checks revealed.

Compression is another part of the representation

Python supports several ZIP compression methods. For DEFLATE, its compression-level setting accepts values from zero through nine. The selected method and settings influence how the member data is represented inside the archive. [1]

Consider another hypothetical pair of archives containing identical named files. One uses a different compression setting. The compressed representation can change while reading the members still returns the original file bytes. Matching member-content digests would be compatible with different archive sizes and different archive digests.

The build environment also needs a defined scope. The Reproducible Builds definition identifies relevant dependencies and their versions, configuration and environment variables among the attributes that can matter. Authors or distributors define which environment attributes and output artifacts their reproducibility claim covers. [3]

Our practical reading is to retain the packaging tool and compression-library versions alongside the relevant settings when investigating a difference. Different version numbers alone do not diagnose the cause. A controlled reproduction can distinguish a metadata change, an ordering change or a compression change from a difference in the files being packaged.

The release promise determines the acceptance decision

Reproducible Builds defines reproducibility in terms of recreating identical specified artifacts from the same source, environment and instructions. It describes verification through complete byte comparison, commonly using cryptographic hashes. [3]

If the specified release artifact is the ZIP file, matching its members is a useful diagnostic result but leaves the complete-artifact requirement unresolved. The scope of that member check also matters: matching names and contents does not automatically establish that all relevant archive metadata or file attributes match.

A hypothetical team might rebuild a downloadable package after its original review, then offer the new archive under the old checksum because the extracted source files appear unchanged. The checksum comparison would fail for recipients. The team needs an explicit decision about which exact artifact it approved and distributes.

That is why a reviewer should keep the approved package’s identity separate from a claim about its contents. In Zyel’s view, a justified explanation for a difference belongs in the evidence record. It does not turn a failed exact-package comparison into a successful one.

State precisely what the review established

A useful report could distinguish matching named member contents, matching relevant metadata and matching complete archive bytes. It can also identify the environment in which those checks passed. These descriptions give the next reviewer a concrete result to assess without requiring them to infer the test’s scope from a green badge.

When reproducibility is limited to a particular toolchain, that boundary belongs beside the result. A repeat build in one environment establishes something different from a successful independent rebuild in another. Expanding the claim requires evidence covering the additional environment, rather than an assumption about compatibility.

The practical goal is an understandable release handover: the approved artifact is identifiable, the relevant inputs and environment are recorded, and each comparison has a clear scope. Matching files can be good evidence. Describing exactly what matched makes that evidence more useful when the next checksum raises a question.

Sources + further reading

Source dates describe the original material. Publication above is the date this Zyel article went live.

  1. Python zipfile: archive members and compression settingsPython project · Checked Nov 11, 2026
  2. Reproducible Builds: archive metadataReproducible Builds project · Checked Nov 11, 2026
  3. Reproducible Builds: definition and build environmentReproducible Builds project · Checked Nov 11, 2026

Reader discussion

What would you ask next?

Questions, useful corrections and thoughtful disagreement are welcome. Comments are reviewed before they appear.

No reader comments yet.

10–2,000 characters. Plain text. Leave out passwords, private project data and personal contact details. A blank display name appears as Anonymous.

Complete the CAPTCHA before sending. Verification runs on your device.