Compare commits
No commits in common. "76d8c4f01ad350cc9e5ce25aa6bb1ff4cca99a02" and "da49b29471e266486feaaebf52d2873406ed9190" have entirely different histories.
76d8c4f01a
...
da49b29471
@ -5,16 +5,12 @@ directories = os.listdir('.') ## Get the files in the current directory
|
||||
files = []
|
||||
|
||||
def quickhash(filefullpath):
|
||||
try:
|
||||
with open(filefullpath, "rb" ) as f:
|
||||
md5 = hashlib.md5()
|
||||
block_size=1024*100
|
||||
data = f.read(block_size)
|
||||
md5.update(data)
|
||||
return md5.digest()
|
||||
except OSError as er:
|
||||
print(f"Error hashing {filefullpath}")
|
||||
return None
|
||||
with open(filefullpath, "rb" ) as f:
|
||||
md5 = hashlib.md5()
|
||||
block_size=1024*100
|
||||
data = f.read(block_size)
|
||||
md5.update(data)
|
||||
return md5.digest()
|
||||
|
||||
def direcCrawler():
|
||||
global directories, files
|
||||
@ -35,7 +31,6 @@ def calchashes():
|
||||
filehashes = {}
|
||||
for file in files:
|
||||
hash = quickhash(file)
|
||||
if hash = None: continue
|
||||
## Inefficient to use a catch on every non-duplicate (most of the files)
|
||||
try: filehashes[hash].append(file)
|
||||
except: filehashes[hash] = [file]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user