mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04: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 len = args[0];
|
||||||
const symbols = args[1];
|
const symbols = args[1];
|
||||||
const numbers = args[2];
|
const numbers = args[2];
|
||||||
|
|
||||||
const baseAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
const baseAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
const lowerAlphabet = baseAlphabet.toLowerCase();
|
const lowerAlphabet = baseAlphabet.toLowerCase();
|
||||||
const symbolSet = "!@#$%^&*()-=_+|'\"";
|
const symbolSet = "!@#$%^&*()-=_+|'\"";
|
||||||
const numberSet = "123456789";
|
const numberSet = "123456789";
|
||||||
|
|
||||||
let alphabet = baseAlphabet + lowerAlphabet;
|
let alphabet = baseAlphabet + lowerAlphabet;
|
||||||
alphabet += symbols ? symbolSet : "";
|
alphabet += symbols ? symbolSet : "";
|
||||||
alphabet += numbers ? numberSet : "";
|
alphabet += numbers ? numberSet : "";
|
||||||
|
|
||||||
const resultArray = new Array(len);
|
const resultArray = new Array(len);
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
resultArray[i] = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
|
resultArray[i] = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultArray.join("");
|
return resultArray.join("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GeneratePassword;
|
export default GeneratePassword;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue