Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated password does not meet specified criteria #356

Open
vivekweb2013 opened this issue May 21, 2024 · 2 comments
Open

Generated password does not meet specified criteria #356

vivekweb2013 opened this issue May 21, 2024 · 2 comments

Comments

@vivekweb2013
Copy link

The gofakeit.Password function does not seem to produce the a password with specified criteria when the tests are executed in parallel.

For example I have

gofakeit.Password(true, true, true, true, false, 12)

in my parallel tests. The tests verify that provided password contains at-least one uppercase & one lowercase character.
The tests are failing intermittently as the generated password sometimes does not include uppercase and lowercase character even if true is specified for the respective parameters.

I think the library only uses the specified sets(uppercase, lowercase, number etc) for generating random password but does not guarantee that chars from these will be included in generated password.

Can we modify the function to add at-least one char from the enabled sets? Or maybe provide another function that does this 🤔

@brianvoe
Copy link
Owner

Ya i dont disagree with you. Unfortunately the only way to solve your issue is to reloop till it matches or rewrite it in a way that would fit better.

@kmurywed
Copy link

+1

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

No branches or pull requests

3 participants