Add hasher() to node_helpers

This commit is contained in:
Thomas Ward 2024-07-04 15:05:08 -04:00 committed by GitHub
parent a065a9081f
commit ac835a45e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,3 +22,8 @@ def pillow(fn, arg):
if prev_value is not None:
ImageFile.LOAD_TRUNCATED_IMAGES = prev_value
return x
def hasher():
# This is a safe eval because args.duplicate_check_hash_function can ONLY
# be one of four predefined strings, keeping it as a safe eval.
return eval(f"hashlib.{args.duplicate_check_hash_function}")