url friendly random strings
This commit is contained in:
parent
a0321905ce
commit
723f05bfca
1 changed files with 4 additions and 1 deletions
|
@ -9,6 +9,9 @@ export abstract class StringHelper {
|
||||||
// randomString += charSet.substring(randomPoz, randomPoz + 1);
|
// randomString += charSet.substring(randomPoz, randomPoz + 1);
|
||||||
// }
|
// }
|
||||||
// return randomString;
|
// return randomString;
|
||||||
return crypto.randomBytes(len).toString("base64");
|
return crypto
|
||||||
|
.randomBytes(len)
|
||||||
|
.toString("base64")
|
||||||
|
.replace(/[^a-zA-Z0-9]/g, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue