Skip to content

Commit 35b5039

Browse files
authored
Switch to using sha256 for hashes (#8251)
1 parent 8571f7d commit 35b5039

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ def hash_digest(data: bytes) -> str:
476476
accidental collision, but we don't really care about any of the
477477
cryptographic properties.
478478
"""
479-
return hashlib.md5(data).hexdigest()
479+
# Once we drop Python 3.5 support, we should consider using
480+
# blake2b, which is faster.
481+
return hashlib.sha256(data).hexdigest()
480482

481483

482484
class FancyFormatter:

0 commit comments

Comments
 (0)