Skip to content

Instantly share code, notes, and snippets.

@edgeboyo
Created January 23, 2021 21:51
Show Gist options
  • Save edgeboyo/166d0050440ee4bbcce6758c2b2c5e24 to your computer and use it in GitHub Desktop.
Save edgeboyo/166d0050440ee4bbcce6758c2b2c5e24 to your computer and use it in GitHub Desktop.
Quick program for hashing file, by drag and drop
#Python 3 code to demonstrate the
# working of MD5 (byte - byte)
import hashlib
import sys
def hash(name):
cont = open(name, "rb").read()
result = hashlib.md5(cont)
print("MD5 hash is : ", end ="")
print(result.digest().hex())
if __name__ == "__main__":
fl = sys.argv[-1]
hash(fl)
input("Press enter to quit...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment