We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f02575 commit 858cb41Copy full SHA for 858cb41
src/utils/random-utils.js
@@ -1,4 +1,7 @@
1
-export const alphanum = 'abcdefghijklmnopqrstuvwyz0123456789'
+const alphanumBase = 'abcdefghijklmnopqrstuvwyz0123456789'
2
+// We need to duplicate the base string to have a longer string
3
+// to avoid Math.random to return the same value twice
4
+export const alphanum = alphanumBase.repeat(10)
5
6
export const getRandomAlphaNum = () => {
7
const randomIndex = Math.floor(Math.random() * alphanum.length)
0 commit comments