Skip to content

Self-hosted, plugin-based server management.

344 B
Raw Blame
/** A random id, with a fallback for insecure contexts that lack randomUUID. */
export function createId(): string {
  if (typeof globalThis.crypto?.randomUUID === "function") {
    return globalThis.crypto.randomUUID();
  }
  return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;
}