()
| 413 | * Not cryptographically secure — suitable for client-side identifiers only. |
| 414 | */ |
| 415 | export function safeUUID(): string { |
| 416 | if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") { |
| 417 | return crypto.randomUUID(); |
| 418 | } |
| 419 | return Math.random().toString(36).substring(2, 11); |
| 420 | } |
no test coverage detected