Skip to content

Commit

Permalink
removing spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
0xff1ce committed Sep 25, 2024
1 parent e5eb846 commit 82712a9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/core/operations/GeneratePassword.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,19 @@ class GeneratePassword extends Operation {
const len = args[0];
const symbols = args[1];
const numbers = args[2];

const baseAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const lowerAlphabet = baseAlphabet.toLowerCase();
const symbolSet = "!@#$%^&*()-=_+|'\"";
const numberSet = "123456789";

let alphabet = baseAlphabet + lowerAlphabet;
alphabet += symbols ? symbolSet : "";
alphabet += numbers ? numberSet : "";

const resultArray = new Array(len);
for (let i = 0; i < len; i++) {
resultArray[i] = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
}

return resultArray.join("");
}

}

export default GeneratePassword;

0 comments on commit 82712a9

Please sign in to comment.