import { createHash } from "node:crypto"; /** The deterministic primary id of a held notice derived from its escalation * key. Sha256 of the key — 64 hex characters, a shape the digest handoff * accepts verbatim — keeps the re-derived notice from a later poll idempotent * against `ON CONFLICT(id) DO NOTHING` while remaining a real ledger row id. */ export function heldNoticeId(key: string): string { return createHash("sha256").update(`held-notice\0${key}`).digest("hex"); }