Closed mleanos closed 6 years ago
Related to #4
I wasn't sure what to do here... https://github.com/brendanashworth/generate-password/pull/5/files#diff-d429632d5f0874d417c9e8e8cc0a3c5dR21
By requiring the repeatCharacterLimit option to be at least 2, if this option was provided, we can avoid any serious performance issues. However, it could be left to the user of this package to decide. They should understand the implications if they provided repeatCharacterLimit: 1
. IMO, this wouldn't be a likely use case.
I just realized there's an issue with this approach.
It's possible to remove 3 repeating characters from the generated password, and the result having 3 or more repeating characters...
For example: "f3dirssuuus48cDd343Dspqw" will become "f3dirsss48cDd343Dspqw"
This should handle the issue described in my last comment.
I'm not sure how else this could be handled. https://github.com/brendanashworth/generate-password/pull/5/files#diff-d429632d5f0874d417c9e8e8cc0a3c5dR51
@brendanashworth I addressed your line comment, and fixed a mistake in the repeatingCharacters
regexp logic.
How do you like this approach overall? If you're fine with merging this, I can squash my commits beforehand.
I didn't see your last line comment until tonight. I changed the option check to conform to the rest of the options. I also squashed.
WDYT?
@mleanos sorry about dropping the ball here. I must have forgotten about this PR — I like where you're going with it, it looks great. If you wouldn't mind adding a test, I can merge this in pretty soon.
I'll spend some time on this over the next couple of days. And no worries. I can understand how this fell under the radar.
Ping @mleanos this requires a little bit of work, are you still up to implementing this?
I'm going to close this, feel free to reopen if you'd like to continue this.
Added repeatCharacterLimit option to restrict repetitive characters to the specified amount. This option is disabled by default.