Skip to content
Snippets Groups Projects
Commit 4439299b authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

[dav][upload] increase block size for sha256 computation to improve performance

parent 40f08faf
No related branches found
No related tags found
1 merge request!210bdt dav upload automatically adds checksum to filename on remote
Pipeline #48737 passed
...@@ -57,7 +57,7 @@ def _get_config(): ...@@ -57,7 +57,7 @@ def _get_config():
def compute_sha256(path): def compute_sha256(path):
sha256_hash = hashlib.sha256() sha256_hash = hashlib.sha256()
with open(path, "rb") as f: with open(path, "rb") as f:
for byte_block in iter(lambda: f.read(4096), b""): for byte_block in iter(lambda: f.read(65535), b""):
sha256_hash.update(byte_block) sha256_hash.update(byte_block)
file_hash = sha256_hash.hexdigest() file_hash = sha256_hash.hexdigest()
return file_hash return file_hash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment