Depending on the language, I usually use regular expressions to check if it has:
- At least one uppercase and one
lowercase letter
- At least one number
- At least one special character
- A length of at least six characters
You can require all of the above, or use a strength meter type of script. For my strength meter, if the password has the right length, it is evaluated as follows:
- One condition met: weak password
- Two conditions met: medium password
- All conditions met: strong password
You can adjust the above to meet your needs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…