From 5526486a0be1053b8cff9883694ee74cc2806e56 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Mon, 24 Mar 2025 18:04:26 -0700 Subject: [PATCH] Use 128bit hash for task ids --- libs/langgraph/langgraph/pregel/algo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/algo.py b/libs/langgraph/langgraph/pregel/algo.py index eeb93b75d..355ccdcff 100644 --- a/libs/langgraph/langgraph/pregel/algo.py +++ b/libs/langgraph/langgraph/pregel/algo.py @@ -23,7 +23,7 @@ from typing import ( from langchain_core.callbacks import Callbacks from langchain_core.callbacks.manager import AsyncParentRunManager, ParentRunManager from langchain_core.runnables.config import RunnableConfig -from xxhash import xxh3_64_hexdigest +from xxhash import xxh3_128_hexdigest from langgraph.channels.base import BaseChannel from langgraph.checkpoint.base import ( @@ -960,7 +960,7 @@ def _uuid5_str(namespace: bytes, *parts: str) -> str: def _xxhash_str(namespace: bytes, *parts: str) -> str: """Generate a UUID from the XXH3 hash of a namespace and str parts.""" - hex = xxh3_64_hexdigest(namespace + b"".join(p.encode() for p in parts)) + hex = xxh3_128_hexdigest(namespace + b"".join(p.encode() for p in parts)) return f"{hex[:8]}-{hex[8:12]}-{hex[12:16]}-{hex[16:20]}-{hex[20:32]}"