Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions oocana/oocana/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions oocana/oocana/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Comment on lines +9 to +13
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string_hash function is placed before the InternalAPI class, but the existing random_string utility function is defined after the class (line 40). For consistency, consider moving string_hash to after the InternalAPI class definition, near random_string, to keep all utility functions grouped together.

Copilot uses AI. Check for mistakes.


class InternalAPI:

Expand Down
Loading