Skip to content

Adding Generate Password Operation#1879

Open
0xff1ce wants to merge 8 commits intogchq:masterfrom
0xff1ce:feat(generatePassword)
Open

Adding Generate Password Operation#1879
0xff1ce wants to merge 8 commits intogchq:masterfrom
0xff1ce:feat(generatePassword)

Conversation

@0xff1ce
Copy link
Copy Markdown
Contributor

@0xff1ce 0xff1ce commented Aug 21, 2024

Generates a password of given length and complexity based on optional inputs for the inclusion of symbols and numbers.

… inputs for the inclusion of symbols and numbers.
> Strings must use doublequote  quotes
> Newline required at end of file but not found  eol-last
@0xff1ce
Copy link
Copy Markdown
Contributor Author

0xff1ce commented Aug 21, 2024

The check seems to be failing on a different test, not sure why that's happening!

@git-commit-amen
Copy link
Copy Markdown

Hey 0xff1ce, really great feature idea. I want this so badly in Cyberchef.
Mind if I clone these changes into my own fork and have a shot at getting the tests to work? Will keep your name in the code-level attributions and all that of course.

@0xff1ce
Copy link
Copy Markdown
Contributor Author

0xff1ce commented Sep 24, 2024

Hey 0xff1ce, really great feature idea. I want this so badly in Cyberchef.

Mind if I clone these changes into my own fork and have a shot at getting the tests to work? Will keep your name in the code-level attributions and all that of course.

That's fine with me, thanks!

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));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Crypto.getRandomValues() rather than Math.Random() as the latter is not suitable for security purposes.

* @param {Object[]} args
* @returns {string}
*/
async run(input, args) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be async?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants