Merge branch 'develop' into feature/2024.10
This commit is contained in:
commit
eb25238a8e
257 changed files with 3053 additions and 68 deletions
|
|
@ -14,10 +14,7 @@ export function secureRndstr(length = 32, { chars = LU_CHARS } = {}): string {
|
|||
let str = '';
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
let rand = Math.floor((crypto.randomBytes(1).readUInt8(0) / 0xFF) * chars_len);
|
||||
if (rand === chars_len) {
|
||||
rand = chars_len - 1;
|
||||
}
|
||||
const rand = crypto.randomInt(0, chars_len);
|
||||
str += chars.charAt(rand);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue