This commit is contained in:
Luiz H. R. Silva 2024-06-02 16:20:44 -03:00
parent 141cc98532
commit 0482d3c102
4 changed files with 8 additions and 7 deletions

View file

@ -1,7 +1,6 @@
const alfabeto = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")
export const aleatorio = (tamanho?: number) =>
Array.from(
{ length: tamanho || 8 },
() => `ale-${alfabeto[Math.floor(Math.random() * 1000) % alfabeto.length]}`,
).join("")
`eli-${Array.from({ length: tamanho || 8 })
.map(() => alfabeto[((999 * Math.random()) | 0) % alfabeto.length])
.join("")}`