|
export function newId(prefix = "id"): string {
|
|
if (typeof crypto !== "undefined" && "randomUUID" in crypto) {
|
|
return `${prefix}_${crypto.randomUUID().slice(0, 8)}`;
|
|
}
|
|
return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
}
|