Skip to content

Commit c3ba7b2

Browse files
committed
MD5 hashing is used for fingerprinting
Clearly state that it is not used for security, so that Static Analysis tools do no flag a false positive.
1 parent 163052c commit c3ba7b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/mlx/warnings/code_quality.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def fingerprint(self):
3232
4. Step 3 is repeated until a unique hash is obtained.
3333
"""
3434
hashable_string = f"{self.severity}{self.path}{self.description}"
35-
new_hash = hashlib.md5(str(hashable_string).encode("utf-8")).hexdigest()
35+
new_hash = hashlib.md5(str(hashable_string).encode("utf-8"), usedforsecurity=False).hexdigest()
3636
while new_hash in self.fingerprints and self.fingerprints[new_hash] != self:
37-
new_hash = hashlib.md5(f"{hashable_string}{new_hash}".encode()).hexdigest()
37+
new_hash = hashlib.md5(f"{hashable_string}{new_hash}".encode(), usedforsecurity=False).hexdigest()
3838
type(self).fingerprints[new_hash] = self
3939
return new_hash
4040

0 commit comments

Comments
 (0)