Skip to content

Instantly share code, notes, and snippets.

@milnomada
Last active June 2, 2018 22:53
Show Gist options
  • Save milnomada/60763712dbe2d6f84cb9ec789b89570d to your computer and use it in GitHub Desktop.
Save milnomada/60763712dbe2d6f84cb9ec789b89570d to your computer and use it in GitHub Desktop.
Python md5 example
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