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

Setting numbers to true in options does not guarantee number used #36

Closed
dallen4 opened this issue Jan 28, 2020 · 2 comments
Closed

Setting numbers to true in options does not guarantee number used #36

dallen4 opened this issue Jan 28, 2020 · 2 comments

Comments

@dallen4
Copy link

dallen4 commented Jan 28, 2020

Details

I'm not sure if the boolean values were intended to always include that character type or only most of the time, but I used this library to aid in a temporary password flow and had a number of instances where providing the following options resulted in a password string without a number.

{
    length: 15,
    lowercase: true,
    uppercase: true,
    symbols: true,
    numbers: true,
    exclude: '+=',
}

I tried this with multiple other options configurations and found that passing a numbers value of true does not in fact guarantee that the generated string will include a numeric value.

@mt-sebastien-robert
Copy link

mt-sebastien-robert commented Jan 29, 2020

Those are ignored if you don't use the strict option.

@brendanashworth
Copy link
Owner

@dallen4 it's true that the strict option is needed to ensure those characters are included in the password. While it may be less intuitive, having that as the default results in passwords with slightly more entropy = strength. Perhaps that should be better documented (PRs are welcome!), but I'm going to close this issue otherwise. 🍾

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

No branches or pull requests

3 participants