Files
Phoenix/bin/mymd5.py
Edouard Choinière 7819799d0d Sort almost all usages of glob.glob for reproducible output
This will help diff-ing logs between invocations to see what is changing when refactoring. When used for creating an archive, it will help creating a reproducible file.
2025-01-28 03:28:11 +00:00

16 lines
327 B
Python

import sys
import glob
import hashlib
def main():
for arg in sys.argv[1:]:
for name in sorted(glob.glob(arg)):
m = hashlib.md5()
with open(name, 'rb') as fid:
m.update(fid.read())
print('%-45s %s' % (name, m.hexdigest()))
if __name__ == '__main__':
main()