mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bug
This commit is contained in:
@@ -159,7 +159,7 @@ public class PasswdStrength {
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNumeric(passwd) && len >= 6) { // 19881010 or 881010
|
||||
if (StrUtil.isNumeric(passwd) && len >= 6 && len <= 8) { // 19881010 or 881010
|
||||
int year = 0;
|
||||
if (len == 8 || len == 6) {
|
||||
year = Integer.parseInt(passwd.substring(0, len - 4));
|
||||
|
@@ -9,4 +9,10 @@ public class PasswdStrengthTest {
|
||||
String passwd = "2hAj5#mne-ix.86H";
|
||||
Assert.assertEquals(13, PasswdStrength.check(passwd));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void strengthNumberTest(){
|
||||
String passwd = "9999999999999";
|
||||
Assert.assertEquals(0, PasswdStrength.check(passwd));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user