Skip to content

Commit

Permalink
Update passwordGenerator.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lruzicki authored Jun 3, 2024
1 parent 75e93f1 commit 7de8c22
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/helpers/passwordGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ export const passwordGenerator = (options) => {

const categoriesArray = getCategoriesArray();

// Select at least one character from each selected category
categoriesArray.forEach((category) => {
password += getRandomOfType(category);
});

// Fill the rest of the password with random characters
for (let i = categoriesArray.length; i < length; i++) {
const randomCategory = categoriesArray[getSafeRandomNumberArray(1, categoriesArray.length)];
password += getRandomOfType(randomCategory);
}

// Shuffle the password to randomize the positions of characters
password = shuffle(password);

return password;
Expand Down

0 comments on commit 7de8c22

Please sign in to comment.