Skip to content

Instantly share code, notes, and snippets.

@jamesandariese
Last active August 27, 2015 20:35
Show Gist options
  • Save jamesandariese/e3a32dc5a86650890bce to your computer and use it in GitHub Desktop.
Save jamesandariese/e3a32dc5a86650890bce to your computer and use it in GitHub Desktop.
hash file by name
def hash_file_by_name(fn):
hash = hashlib.sha256()
with open(fn) as f:
block = f.read(1024*1024)
hash.update(block)
return hash.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment