From ac835a45e1f228cbe788c8f96f884e55b2563422 Mon Sep 17 00:00:00 2001 From: Thomas Ward Date: Thu, 4 Jul 2024 15:05:08 -0400 Subject: [PATCH] Add hasher() to node_helpers --- node_helpers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node_helpers.py b/node_helpers.py index 43b9e829f..9ee907dca 100644 --- a/node_helpers.py +++ b/node_helpers.py @@ -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}")