Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Hash a large file in Python
import hashlib as hash
# Specify how many bytes of the file you want to open at a time
sha = hash.sha256()
with open('kali.iso', 'rb') as kali_file:
file_buffer =
while len(file_buffer) > 0:
file_buffer =
print sha.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.