Skip to content

Commit bdd7525

Browse files
authored
MD5 for FIPS (#872)
1 parent bd932c3 commit bdd7525

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fsspec/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,11 @@ def tokenize(*args, **kwargs):
281281
"""
282282
if kwargs:
283283
args += (kwargs,)
284-
return md5(str(args).encode()).hexdigest()
284+
try:
285+
return md5(str(args).encode()).hexdigest()
286+
except ValueError:
287+
# FIPS systems: https://github.com/fsspec/filesystem_spec/issues/380
288+
return md5(str(args).encode(), usedforsecurity=False).hexdigest()
285289

286290

287291
def stringify_path(filepath):

0 commit comments

Comments
 (0)