Created
January 23, 2021 21:51
-
-
Save edgeboyo/166d0050440ee4bbcce6758c2b2c5e24 to your computer and use it in GitHub Desktop.
Quick program for hashing file, by drag and drop
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
#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