diff --git a/find_duplicate_files/find_duplicate_files.py b/find_duplicate_files/find_duplicate_files.py index f57b892..3020a12 100644 --- a/find_duplicate_files/find_duplicate_files.py +++ b/find_duplicate_files/find_duplicate_files.py @@ -47,9 +47,8 @@ class find_duplicate_files: if file.is_file(): hash = hashlib.sha256() with open(file.path, 'r') as file_pointer: - file_content = file_pointer.read() - hash.update(file_content.encode('utf-8')) - files[hash.hexdigest()] = file.path + digest = hashlib.file_digest(f, "sha256") + files[digest.hexdigest()] = file.path elif file.is_dir(follow_symlinks=False): more_files = self.recursive_scandir( file.path,