Created
June 24, 2022 09:31
-
-
Save potat-dev/ee7688c01c0617eab1e8a456c8eef114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# вычисляет хэш нескольких файлов | |
from hashlib import md5 | |
def files_hash(files): | |
temp = md5() | |
for file in tqdm(files, desc="calculating files hash"): | |
with open(file, "rb") as f: | |
for chunk in iter(lambda: f.read(4096), b""): | |
temp.update(chunk) | |
return temp.hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment