use crc
This commit is contained in:
parent
865d0c2a96
commit
c75d875a27
1 changed files with 3 additions and 4 deletions
|
@ -11,7 +11,7 @@ import logging
|
||||||
import click
|
import click
|
||||||
import click_config_file
|
import click_config_file
|
||||||
from logging.handlers import SysLogHandler
|
from logging.handlers import SysLogHandler
|
||||||
import hashlib
|
import zlib
|
||||||
|
|
||||||
class find_duplicate_files:
|
class find_duplicate_files:
|
||||||
|
|
||||||
|
@ -45,11 +45,10 @@ class find_duplicate_files:
|
||||||
for file in os.scandir(path):
|
for file in os.scandir(path):
|
||||||
if not file.name.startswith('.'):
|
if not file.name.startswith('.'):
|
||||||
if file.is_file():
|
if file.is_file():
|
||||||
hash = hashlib.sha256()
|
|
||||||
with open(file.path, 'rb') as file_pointer:
|
with open(file.path, 'rb') as file_pointer:
|
||||||
file_content = file_pointer.read()
|
file_content = file_pointer.read()
|
||||||
hash.update(file_content)
|
hash = zlib.adler32(file_content)
|
||||||
files[hash.hexdigest()] = file.path
|
files[hash] = file.path
|
||||||
elif file.is_dir(follow_symlinks=False):
|
elif file.is_dir(follow_symlinks=False):
|
||||||
more_files = self.recursive_scandir(
|
more_files = self.recursive_scandir(
|
||||||
file.path,
|
file.path,
|
||||||
|
|
Loading…
Reference in a new issue