public class CipherStrength extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static int |
CAPITAL_LETTER
大写
|
private static int |
CHAR_0
字符 0
|
private static int |
CHAR_9
字符 9
|
private static int |
CHAR_A
字符 A
|
private static int |
CHAR_L_A
字符 a
|
private static int |
CHAR_L_Z
字符 z
|
private static int |
CHAR_Z
字符 Z
|
private static String[] |
DICTIONARY |
private static int |
NUM
数字
|
private static int |
NUM_0
数字0
|
private static int |
NUM_1
数字1
|
private static int |
NUM_10
数字10
|
private static int |
NUM_12
数字12
|
private static int |
NUM_13
数字13
|
private static int |
NUM_16
数字16
|
private static int |
NUM_2
数字2
|
private static int |
NUM_3
数字3
|
private static int |
NUM_4
数字4
|
private static int |
NUM_6
数字6
|
private static int |
NUM_7
数字7
|
private static int |
NUM_8
数字8
|
private static int |
OTHER_CHAR
其他字符
|
private static int |
SMALL_LETTER
小写
|
| 构造器和说明 |
|---|
CipherStrength() |
| 限定符和类型 | 方法和说明 |
|---|---|
private static int |
basePassword(String password)
是否为基本密码
|
private static int |
checkCharacterType(char c)
字符类型
|
private static boolean |
combination(String password,
int combinationNum,
int standardNum,
Integer otherNum)
判断密码的组合方式
|
private static int |
combinationScore(String password)
密码的组合模式
|
private static int |
countLetter(String password,
int type)
计算字符串类型的长度
|
private static int |
datePassword(String password)
密码是否为日期
|
private static boolean |
indexOf(String password,
String[] resources)
判断密码是否为 弱密码
|
private static boolean |
isCharEqual(String str)
判断字符串的每个字符是否相等
|
private static int |
lengthPassword(String password)
密码长度分数
|
static int |
passwordStrength(String password)
密码强度检测
[0, 4)弱密码
[4, 7)中等密码
[7, 10)强密码
[10, 13)非常强
[13, +∞)极端强
|
static String |
passwordStrengthLevel(String password)
返回密码强度
|
static int |
sectionEqual(int sectionNum,
String password)
分段相关
|
static boolean |
weakPassword(String password)
判断密码是否为弱密码
|
private static final int NUM
private static final int SMALL_LETTER
private static final int CAPITAL_LETTER
private static final int OTHER_CHAR
private static final int NUM_0
private static final int NUM_1
private static final int NUM_2
private static final int NUM_3
private static final int NUM_4
private static final int NUM_6
private static final int NUM_7
private static final int NUM_8
private static final int NUM_10
private static final int NUM_12
private static final int NUM_13
private static final int NUM_16
private static final int CHAR_0
private static final int CHAR_9
private static final int CHAR_A
private static final int CHAR_Z
private static final int CHAR_L_A
private static final int CHAR_L_Z
private static final String[] DICTIONARY
public static int passwordStrength(String password)
[0, 4)弱密码
[4, 7)中等密码
[7, 10)强密码
[10, 13)非常强
[13, +∞)极端强
password - 密码public static String passwordStrengthLevel(String password)
password - 密码public static boolean weakPassword(String password)
password - 密码private static int checkCharacterType(char c)
c - 字符private static int countLetter(String password, int type)
password - 密码type - 类型private static int combinationScore(String password)
password - 密码private static boolean combination(String password, int combinationNum, int standardNum, Integer otherNum)
password - 密码combinationNum - 组合数standardNum - 长度otherNum - 其他的长度private static int lengthPassword(String password)
password - 密码private static int basePassword(String password)
password - 密码private static int datePassword(String password)
password - 日期public static int sectionEqual(int sectionNum,
String password)
sectionNum - 分段password - 密码private static boolean indexOf(String password, String[] resources)
password - 密码resources - 弱密码库private static boolean isCharEqual(String str)
str - 字符Copyright © 2024. All rights reserved.