Skip to content

Commit

Permalink
Update Sloth_Hash.py
Browse files Browse the repository at this point in the history
Critical Bug fix
  • Loading branch information
pingwcy committed Nov 10, 2022
1 parent 09a6232 commit 35f116d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sloth_Hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import hashlib

def get_file_checksum(filename):
chunk_size = 8192
chunk_size = 8096

md5 = hashlib.md5()
sha256 = hashlib.sha256()
Expand All @@ -13,20 +13,20 @@ def get_file_checksum(filename):
if len(chunk) == 0:
break
md5.update(chunk)

with open(filename, 'rb') as f:
while True:
chunk = f.read(chunk_size)
if len(chunk) == 0:
break
sha256.update(chunk)

with open(filename, 'rb') as f:
while True:
chunk = f.read(chunk_size)
if len(chunk) == 0:
break
sha512.update(chunk)

return md5.hexdigest(), sha256.hexdigest(), sha512.hexdigest()
return md5.hexdigest(),sha256.hexdigest(), sha512.hexdigest()
def get_str_checksum(string):
md5 = hashlib.md5()#
sha256 = hashlib.sha256()#
Expand Down

0 comments on commit 35f116d

Please sign in to comment.