wagslane / go-password-validator

Validate the Strength of a Password in Go
https://blog.boot.dev/open-source/how-to-validate-passwords/
MIT License
493 stars 39 forks source link

Passwords with fghijkl are reported as more secure than they are #15

Open davidjwilkins opened 1 year ago

davidjwilkins commented 1 year ago

Describe the bug The getLength function is supposed to strip sequential characters after a run length of 2. e.g. fghijkl should become fg.

However, because it first replaces the sequence asdfghjkl, it changes fghijkl to fgijk, which then becomes 'fgij, a length of 4.

To Reproduce

https://github.com/wagslane/go-password-validator/pull/14

Expected behavior It should change fghijkl to fg

Screenshots If applicable, add screenshots or console output that helps explain the situation

Environment (please complete the following information):

Additional context Add any other context about the problem here.