chore: Switch to sha256 from md5 to remedy CodeQL warning (#3356)
This use of md5 doesn't appear to be a cryptographically sensitive context, but the easiest remediation for the CodeQL warning is to switch to an approved hash function.
This commit is contained in:
Родитель
6a36786a3f
Коммит
cb3b0343fc
|
@ -103,7 +103,7 @@ for orientation in ExifTags.TAGS.keys():
|
|||
def get_hash(paths):
|
||||
# Returns a single hash value of a list of paths (files or dirs)
|
||||
size = sum(os.path.getsize(p) for p in paths if os.path.exists(p)) # sizes
|
||||
h = hashlib.md5(str(size).encode()) # hash sizes
|
||||
h = hashlib.sha256(str(size).encode()) # hash sizes
|
||||
h.update("".join(paths).encode()) # hash paths
|
||||
return h.hexdigest() # return hash
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче