Skip to content

Instantly share code, notes, and snippets.

@cppio
Created December 25, 2025 00:06
Show Gist options
  • Select an option

  • Save cppio/3c13e415a31c3df58ac1cb0b105caa8f to your computer and use it in GitHub Desktop.

Select an option

Save cppio/3c13e415a31c3df58ac1cb0b105caa8f to your computer and use it in GitHub Desktop.
import hashlib, sys, zipfile
with zipfile.ZipFile(sys.argv[1]) as zip:
for filename in sorted(zip.namelist()):
if filename.endswith("/"):
continue
with zip.open(filename) as file:
print(hashlib.file_digest(file, sys.argv[2]).hexdigest(), filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment