mirror of
https://github.com/gchq/CyberChef
synced 2025-01-26 03:05:06 +00:00
removing spacing
This commit is contained in:
parent
e5eb84682b
commit
82712a9c3f
1 changed files with 0 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue