Created
December 26, 2014 06:47
-
-
Save philipaconrad/93166236ce69b3a20939 to your computer and use it in GitHub Desktop.
Command line script that shows the MD5 checksum for a given file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# md5.py -- Simple MD5 checksum tool in Python. | |
# By Philip Conrad on 2014-12-26. Public Domain. | |
import hashlib | |
import sys | |
if __name__ == '__main__': | |
try: | |
m = hashlib.md5() | |
text = open(sys.argv[1], "rb").read() | |
m.update(text) | |
print m.hexdigest() | |
except IndexError: | |
print "USAGE: python md5.py FILENAME\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment