diff --git a/oocana/oocana/context.py b/oocana/oocana/context.py index 40f4cac..3c3bb0d 100644 --- a/oocana/oocana/context.py +++ b/oocana/oocana/context.py @@ -10,21 +10,14 @@ from .throttler import throttle from .preview import PreviewPayload, DataFrame, PreviewPayloadInternal, ShapeDataFrame from .data import EXECUTOR_NAME -from .internal import random_string, InternalAPI +from .internal import random_string, InternalAPI, string_hash from .credential import CredentialInput import os.path import logging -import hashlib __all__ = ["Context", "HandleDefDict", "BlockJob", "BlockExecuteException"] -def string_hash(text: str) -> str: - """ - Generates a deterministic hash for a given string. - """ - return hashlib.sha256(text.encode('utf-8')).hexdigest() - class ToNode(TypedDict): node_id: str diff --git a/oocana/oocana/internal.py b/oocana/oocana/internal.py index cbecf74..466a322 100644 --- a/oocana/oocana/internal.py +++ b/oocana/oocana/internal.py @@ -3,6 +3,15 @@ import random import string import math +import hashlib + + +def string_hash(text: str) -> str: + """ + Generates a deterministic hash for a given string. + """ + return hashlib.sha256(text.encode('utf-8')).hexdigest() + class InternalAPI: