1
0
Fork 0
mirror of synced 2024-06-28 02:50:27 +12:00

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