read bytes

This commit is contained in:
Antonio J. Delgado 2023-01-25 14:49:51 +02:00
parent 0af63228b5
commit c90a0561d4

View file

@ -47,8 +47,9 @@ class find_duplicate_files:
if file.is_file():
hash = hashlib.sha256()
with open(file.path, 'rb') as file_pointer:
digest = hashlib.file_digest(file_pointer, "sha256")
files[digest.hexdigest()] = file.path
file_content = file_pointer.read()
hash.update(file_content.encode('utf-8'))
files[hash.hexdigest()] = file.path
elif file.is_dir(follow_symlinks=False):
more_files = self.recursive_scandir(
file.path,