Class SessionIdUtils

java.lang.Object
io.agentscope.harness.agent.gateway.SessionIdUtils

public final class SessionIdUtils extends Object
Deterministic session-ID derivation. Produces a 12-character hex string from arbitrary input parts using SHA-256, guaranteeing the same inputs always yield the same output regardless of JVM instance or machine.
  • Method Details

    • deterministicHash

      public static String deterministicHash(String... parts)
      Returns a 12-character lowercase hex hash derived from the given parts joined by "/".

      The hash is deterministic: identical inputs produce identical output on any machine. The output is filename-safe (lowercase hex only). Collision probability is negligible for practical session counts (2^48 space).

      Parameters:
      parts - one or more non-null seed values
      Returns:
      12-char hex string