Add crc32.py.

This commit is contained in:
voussoir 2020-05-12 18:17:17 -07:00
parent e5e0166ee2
commit 123f475d65

11
crc32.py Normal file
View file

@ -0,0 +1,11 @@
import sys
import zlib
from voussoirkit import winglob
patterns = sys.argv[1:]
files = [file for pattern in patterns for file in winglob.glob(pattern)]
for file in files:
with open(file, 'rb') as handle:
crc = zlib.crc32(handle.read())
print(hex(crc)[2:].rjust(8, '0'), file)