Last active
August 29, 2015 14:22
-
-
Save jandrusk/671f4dce73d0252662f1 to your computer and use it in GitHub Desktop.
get_hashes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetSHA512(filename): | |
# Function to return SHA512 hash of given file. | |
import hashlib | |
BLOCKSIZE = 65536 | |
hasher = hashlib.sha512() | |
with open(filename, 'rb') as afile: | |
buf = afile.read(BLOCKSIZE) | |
while len(buf) > 0: | |
hasher.update(buf) | |
buf = afile.read(BLOCKSIZE) | |
return hasher.hexdigest() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment