Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace md5 with sha256 #2905

Merged
merged 1 commit into from Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -25,6 +25,7 @@
- Do not format `__pypackages__` directories by default (#2836)
- Add support for specifying stable version with `--required-version` (#2832).
- Avoid crashing when the user has no homedir (#2814)
- Avoid crashing when md5 is not available (#2905)

### Documentation

Expand Down
4 changes: 2 additions & 2 deletions src/black/mode.py
Expand Up @@ -4,7 +4,7 @@
chosen by the user.
"""

from hashlib import md5
from hashlib import sha256
import sys

from dataclasses import dataclass, field
Expand Down Expand Up @@ -182,6 +182,6 @@ def get_cache_key(self) -> str:
str(int(self.magic_trailing_comma)),
str(int(self.experimental_string_processing)),
str(int(self.preview)),
md5((",".join(sorted(self.python_cell_magics))).encode()).hexdigest(),
sha256((",".join(sorted(self.python_cell_magics))).encode()).hexdigest(),
]
return ".".join(parts)