1 | import { exportaAHtml } from "./exportaAHtml.js" |
2 | |
3 | /** |
4 | * Añade caracteres al azar a una raíz, para obtener un clientId único. |
5 | * @param {string} raiz |
6 | */ |
7 | export function creaIdCliente(raiz) { |
8 | const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" |
9 | for (var i = 0; i < 15; i++) { |
10 | raiz += chars.charAt(Math.floor(Math.random() * chars.length)) |
11 | } |
12 | return raiz |
13 | } |
14 | |
15 | exportaAHtml(creaIdCliente) |