mirror of
https://git.atakanozban.com/Songs2VID/songs2vid.git
synced 2026-11-14 21:29:49 +01:00
8 lines
331 B
TypeScript
8 lines
331 B
TypeScript
|
|
/** UUID for client-side ids (upload sessions, list keys). Safe in older WebViews. */
|
||
|
|
export function createClientId(): string {
|
||
|
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
||
|
|
return crypto.randomUUID();
|
||
|
|
}
|
||
|
|
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
|
||
|
|
}
|