Unverified Commit ce13ced5 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #6772 from vladmandic/sha-calc-optimization

increase block size
parents 006997d1 f0312565
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -34,9 +34,10 @@ def cache(subsection):

def calculate_sha256(filename):
    hash_sha256 = hashlib.sha256()
    blksize = 1024 * 1024

    with open(filename, "rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
        for chunk in iter(lambda: f.read(blksize), b""):
            hash_sha256.update(chunk)

    return hash_sha256.hexdigest()