diff --git a/find_duplicate_files/find_duplicate_files.py b/find_duplicate_files/find_duplicate_files.py index ecafbe0..d374c9b 100644 --- a/find_duplicate_files/find_duplicate_files.py +++ b/find_duplicate_files/find_duplicate_files.py @@ -11,7 +11,7 @@ import logging import click import click_config_file from logging.handlers import SysLogHandler -import hashlib +import zlib class find_duplicate_files: @@ -45,11 +45,10 @@ class find_duplicate_files: for file in os.scandir(path): if not file.name.startswith('.'): if file.is_file(): - hash = hashlib.sha256() with open(file.path, 'rb') as file_pointer: file_content = file_pointer.read() - hash.update(file_content) - files[hash.hexdigest()] = file.path + hash = zlib.adler32(file_content) + files[hash] = file.path elif file.is_dir(follow_symlinks=False): more_files = self.recursive_scandir( file.path,