responses.js / src /lib /generateUniqueId.ts
Wauplin's picture
Wauplin HF Staff
Upload folder using huggingface_hub
3d97d52 verified
raw
history blame contribute delete
284 Bytes
/**
* AI-generated file using Cursor + Claude 4
*
* Generate a unique ID for the response
*/
import { randomBytes } from "crypto";
export function generateUniqueId(prefix?: string): string {
const id = randomBytes(24).toString("hex");
return prefix ? `${prefix}_${id}` : id;
}