forked from Qortal/qortal-ui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
363 B
12 lines
363 B
3 years ago
|
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
|
||
|
}
|