@chilimatic described the basics in great detail and lots of simple strength checkers work like that. You can improve the strength checker by
a to @)In general, just think like a person who wants to crack into an account. What kind of stuff would you try?
j
stuff ;)
depends on what you believe
length beats complexity
so if you take length and the character set in consideration -> lets assume ascii for this example and only the letters in upper and lowercase.
you have 54 possibilities per position so based on the length it can be
so the complexity idea is to increase the base by "special characters and numbers" which allows you to keep shorter passwords which are harder to bruteforce.
as you see that increasing the base does make it harder, still it's safer to just write a password sentence like "inmyopinionilikebatmanmorethansuperman" which would be
so basically you can take those ranges and define ranges like "0-4 chars weak" "5-8 chars medium" "5-8 chars plus one number and one specialcharacter safe enough" > "good password"
basically you first check the length > than the alphabet and if it's above a certain number of possibilities you say it's safe :) .....
i would recommend a lib for that :)