Skip to content

Instantly share code, notes, and snippets.

View DaveCTurner's full-sized avatar

David Turner DaveCTurner

View GitHub Profile
@DaveCTurner
DaveCTurner / tarsum
Last active April 8, 2020 16:38
SHA1 hashes of contents of TAR archive without extracting the archive first
#!/usr/bin/python
import sys
import tarfile
import hashlib
for filename in sys.argv[1:]:
print filename
with tarfile.open(filename, 'r') as tar:
for tarinfo in tar: