Update passwordGenerator loop start index
This commit is contained in:
parent
b22d5baacc
commit
25cf3f103f
|
@ -40,7 +40,7 @@ export function passwordGenerator(length = 8) {
|
|||
// )
|
||||
|
||||
// Add random characters to the password until it reaches the desired length
|
||||
for (let i = 4; i < length; i++) {
|
||||
for (let i = 3; i < length; i++) {
|
||||
password += characterSet.charAt(
|
||||
Math.floor(Math.random() * characterSet.length)
|
||||
)
|
||||
|
@ -49,9 +49,7 @@ export function passwordGenerator(length = 8) {
|
|||
// Shuffle the password
|
||||
password = password
|
||||
.split('')
|
||||
.sort(function () {
|
||||
return 0.5 - Math.random()
|
||||
})
|
||||
.sort(() => 0.5 - Math.random())
|
||||
.join('')
|
||||
|
||||
return password
|
||||
|
|
Loading…
Reference in New Issue
Block a user