import { createHash } from "node:crypto";
import type { Priority1DemoInput } from "@/workers/rpa/priority1/demo-input";

/** Priority1 输入稳定哈希（32 hex） */
export function hashPriority1Input(input: Priority1DemoInput): string {
  const stable = JSON.stringify(input, Object.keys(input).sort());
  return createHash("sha256").update(stable).digest("hex").slice(0, 32);
}
