Skip to content

Instantly share code, notes, and snippets.

@tetra5
Created June 3, 2013 07:17
Show Gist options
  • Save tetra5/5696552 to your computer and use it in GitHub Desktop.
Save tetra5/5696552 to your computer and use it in GitHub Desktop.
def _hash(entity):
try:
from hashlib import md5
except ImportError:
from md5 import new as md5
return int(md5(repr(entity)).hexdigest(), 16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment