diff --git a/umap/static/umap/js/modules/utils.js b/umap/static/umap/js/modules/utils.js index 03081308..aa681602 100644 --- a/umap/static/umap/js/modules/utils.js +++ b/umap/static/umap/js/modules/utils.js @@ -1,7 +1,7 @@ /** - * Generate a pseudo-unique identifier (4 chars long) + * Generate a pseudo-unique identifier (5 chars long, mixed-case alphanumeric) * - * Using uppercase + lowercase + digits, here's the collision risk: + * Here's the collision risk: * - for 6 chars, 1 in 100 000 * - for 5 chars, 5 in 100 000 * - for 4 chars, 500 in 100 000 @@ -9,5 +9,5 @@ * @returns string */ export function generateId() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) + return btoa(Math.random().toString()).substring(10, 15) }