Rename variable

This commit is contained in:
Serene-Arc
2021-05-23 12:13:44 +10:00
parent 5aae6b3df8
commit 47a4951279

View File

@@ -22,13 +22,13 @@ logger = logging.getLogger(__name__)
def _calc_hash(existing_file: Path): def _calc_hash(existing_file: Path):
CHUNK_SIZE = 1024 * 1024 chunk_size = 1024 * 1024
md5_hash = hashlib.md5() md5_hash = hashlib.md5()
with open(existing_file, 'rb') as file: with open(existing_file, 'rb') as file:
chunk = file.read(CHUNK_SIZE) chunk = file.read(chunk_size)
while chunk: while chunk:
md5_hash.update(chunk) md5_hash.update(chunk)
chunk = file.read(CHUNK_SIZE) chunk = file.read(chunk_size)
file_hash = md5_hash.hexdigest() file_hash = md5_hash.hexdigest()
return existing_file, file_hash return existing_file, file_hash