check empty file hash - do not include empty files in hash list
This commit is contained in:
@@ -33,7 +33,8 @@ def get_hashes_in_dir(dir_path: str, excluded_filenames: list = []) -> list: #
|
||||
filepath = os.path.join(subdir, filename)
|
||||
with open(filepath, 'rb') as f:
|
||||
filehash = hashlib.sha256(f.read()).hexdigest()
|
||||
hash_list.append({ 'filepath': filepath, 'filename': filename, 'sha256 hash': filehash})
|
||||
if filehash != 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855': # do not include hashes of empty files
|
||||
hash_list.append({ 'filepath': filepath, 'filename': filename, 'sha256 hash': filehash})
|
||||
return hash_list
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user