Last active
June 2, 2018 22:53
-
-
Save milnomada/60763712dbe2d6f84cb9ec789b89570d to your computer and use it in GitHub Desktop.
Python md5 example
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
import hashlib, sys | |
def main(argv): | |
try: | |
_str=str(argv[0]) | |
print(md5(_str)) | |
except: | |
print("Invalid string") | |
def md5(str): | |
m = hashlib.md5() | |
m.update(str.encode('utf-8')) | |
return m.hexdigest() | |
if __name__ == "__main__": | |
main(sys.argv[1:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment