aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-01-15 16:09:46 +0000
committerGitHub <noreply@github.com>2023-01-15 16:09:46 +0000
commitce13ced5dc5ce06634b3313bbfed6d479f8a4538 (patch)
treefa0f73d11a726a21e86d1348b020c8c832dce896
parent006997d18023d873b0c851cbfa6cd8ac1da57f0a (diff)
parentf0312565e5b4d56a421af889a9a8eaea0ba92959 (diff)
downloadstable-diffusion-webui-gfx803-ce13ced5dc5ce06634b3313bbfed6d479f8a4538.tar.gz
stable-diffusion-webui-gfx803-ce13ced5dc5ce06634b3313bbfed6d479f8a4538.tar.bz2
stable-diffusion-webui-gfx803-ce13ced5dc5ce06634b3313bbfed6d479f8a4538.zip
Merge pull request #6772 from vladmandic/sha-calc-optimization
increase block size
-rw-r--r--modules/hashes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/hashes.py b/modules/hashes.py
index 14231771..b85a7580 100644
--- a/modules/hashes.py
+++ b/modules/hashes.py
@@ -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()