Skip to content

Commit f3f4cb3

Browse files
Password Strength Checker
2 parents 856509a + 8d38663 commit f3f4cb3

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

passwd_strength/PasswordStrength.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,17 @@ public static void main(final String ar[]) {
1212
char x = password.charAt(i);
1313
if (Character.isLetter(x)) {
1414
if (Character.isUpperCase(x)) {
15-
1615
hasUpperCase = true;
17-
1816
} else if (Character.isLowerCase(x)) {
19-
2017
hasLowerCase = true;
2118
}
22-
2319
hasLetter = true;
2420
} else if (Character.isDigit(x)) {
25-
2621
hasDigit = true;
2722
}
28-
29-
// no need to check further, break the loop
30-
if (hasLetter && hasDigit && hasUpperCase && hasLowerCase) {
31-
23+
if (hasLetter && hasDigit && hasUpperCase && hasLowerCase) {
3224
break;
3325
}
34-
3526
}
3627
if (hasLetter && hasDigit && hasUpperCase && hasLowerCase) {
3728
System.out.println("STRONG");

0 commit comments

Comments
 (0)