mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-07-30 13:41:44 +00:00
Redsign qortal-ui repo
This commit is contained in:
11
crypto/api/utils/randomBase58Generator.js
Normal file
11
crypto/api/utils/randomBase58Generator.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export const randomBase58Generator = (digits) => {
|
||||
digits = digits || 0
|
||||
let base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'.split('')
|
||||
let result = ''
|
||||
let char
|
||||
while (result.length < digits) {
|
||||
char = base58[Math.random() * 57 >> 0]
|
||||
if (result.indexOf(char) === -1) result += char
|
||||
}
|
||||
return result
|
||||
}
|
Reference in New Issue
Block a user