/** * Search-box.ai * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * File: packages/shared/src/ids.ts * Description: Prefixed unique id generation for research entities. */ import { randomBytes } from "node:crypto"; export type IdPrefix = "ses" | "src" | "ev" | "clm" | "ctr" | "evt"; export function newId(prefix: IdPrefix): string { return `${prefix}_${randomBytes(9).toString("base64url")}`; }