You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
First, thanks for sharing your solution:)
I was looking into your Generate method. I have suggestion for improvement if you want.
All your parameters are marked with word "require" so from this perspective it's working correctly. Let me explain what I have in mind.
So if you would want to use those parameter as condition to include or not include specific chars (like I want password without digits) than "for" loop will return wrong password for you.
In line:
string rcs = randomChars[rand.Next(0, randomChars.Length)];
you are going back to randomChars which contains all chars(including in this sample digits).
If you would like to improve your method than I would suggest to add additional property which will held only chars filtered by you parameters and then use this property to populates rcs.
This way you will be able to produce password with "required" chars and password which will not have specific chars on your wish.
Cheers
The text was updated successfully, but these errors were encountered:
Hi.
First, thanks for sharing your solution:)
I was looking into your Generate method. I have suggestion for improvement if you want.
All your parameters are marked with word "require" so from this perspective it's working correctly. Let me explain what I have in mind.
So if you would want to use those parameter as condition to include or not include specific chars (like I want password without digits) than "for" loop will return wrong password for you.
In line:
string rcs = randomChars[rand.Next(0, randomChars.Length)];
you are going back to randomChars which contains all chars(including in this sample digits).
If you would like to improve your method than I would suggest to add additional property which will held only chars filtered by you parameters and then use this property to populates rcs.
This way you will be able to produce password with "required" chars and password which will not have specific chars on your wish.
Cheers
The text was updated successfully, but these errors were encountered: