Skip to content

Instantly share code, notes, and snippets.

@MagneticMule
Created November 9, 2015 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MagneticMule/36e7c17a0f4ef0923d5c to your computer and use it in GitHub Desktop.
Save MagneticMule/36e7c17a0f4ef0923d5c to your computer and use it in GitHub Desktop.
def hash(s):
"""returns an MD5 hash of the passed string s
We have to encode the passed string as ascii """
hash = ''
if s is not None:
hash = hashlib.md5(s.encode('ascii', 'ignore')).hexdigest()
return hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment