diff --git a/elementary/tracking/tracking_interface.py b/elementary/tracking/tracking_interface.py index 06fdbfd0e..9ff973f31 100644 --- a/elementary/tracking/tracking_interface.py +++ b/elementary/tracking/tracking_interface.py @@ -1,9 +1,9 @@ -import hashlib from typing import Any, Dict, Optional import posthog from elementary.config.config import Config +from elementary.utils.hash import hash class Tracking: @@ -36,7 +36,7 @@ def _send_event( @staticmethod def _hash(content: str): - return hashlib.sha256(content.encode("utf-8")).hexdigest() + return hash(content) def record_internal_exception(self, exc: Exception): pass diff --git a/elementary/utils/hash.py b/elementary/utils/hash.py new file mode 100644 index 000000000..4374b1dd9 --- /dev/null +++ b/elementary/utils/hash.py @@ -0,0 +1,5 @@ +import hashlib + + +def hash(content: str): + return hashlib.sha256(content.encode("utf-8")).hexdigest()