Skip to content

Instantly share code, notes, and snippets.

@nitely
Created August 31, 2015 09:07
Show Gist options
  • Save nitely/c6cb384304dca2f9d860 to your computer and use it in GitHub Desktop.
Save nitely/c6cb384304dca2f9d860 to your computer and use it in GitHub Desktop.
Django hash from file
import hashlib
def get_hash(file):
md5 = hashlib.md5()
for c in file.chunks():
md5.update(c)
return md5.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment