We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 486e477 commit cd73fdfCopy full SHA for cd73fdf
libgravatar/__init__.py
@@ -249,7 +249,12 @@ def md5_hash(string):
249
'0bc83cb571cd1c50ba6f3e8a78ef1346'
250
251
"""
252
- return md5(string.encode("utf-8")).hexdigest()
+ try:
253
+ # On security-restricted systems, indicate we are fingerprinting only:
254
+ return md5(string.encode("utf-8"), usedforsecurity=False).hexdigest()
255
+ except TypeError:
256
+ # On systems without usedforsecurity:
257
+ return md5(string.encode("utf-8")).hexdigest()
258
259
260
def default_url_is_valid(url):
0 commit comments