Reputation: 57
I'm validating passwords. I need to check how many letters and numbers there are in a password. If there were less than 2 numbers or less than 2 letters, the user should be warned about an invalid password.
Upvotes: 1
Views: 187
Reputation: 16636
For each character in the password, check against the ASCII table and count letters and numbers appearances:
Consider adding special characters to the validation.
Upvotes: 0