better random, improved map

This commit is contained in:
evanpelle
2024-09-05 19:19:52 -07:00
parent 79aa06aed5
commit 4161b4d71c
6 changed files with 15 additions and 9 deletions
+7
View File
@@ -97,4 +97,11 @@ export function getMode(list: string[]): string {
}
return mode;
}
export function generateUniqueId(): string {
if (typeof crypto === 'undefined' || !crypto.randomUUID) {
throw new Error('crypto.randomUUID is not supported in this environment');
}
return crypto.randomUUID();
}