美文网首页
iOS 检测密码强度

iOS 检测密码强度

作者: iBlocker | 来源:发表于2019-04-10 14:18 被阅读0次

CCPassStrength

密码强度级别(CCStrengthLevel)

typedef NS_ENUM(NSUInteger, CCStrengthLevel) {
    CCStrengthLevelEASY = 0,
    CCStrengthLevelMIDIUM,
    CCStrengthLevelSTRONG,
    CCStrengthLevelVERY_STRONG,
    CCStrengthLevelEXTREMELY_STRONG
};

使用方法

    NSLog(@"111111 --- %zd", [@"111111" passwordLevel]);
    NSLog(@"123456 --- %zd", [@"123456" passwordLevel]);
    NSLog(@"ababab --- %zd", [@"ababab" passwordLevel]);
    NSLog(@"abc123 --- %zd", [@"abc123" passwordLevel]);
    NSLog(@"123abc --- %zd", [@"123abc" passwordLevel]);
    NSLog(@"password --- %zd", [@"password" passwordLevel]);
    NSLog(@"Password --- %zd", [@"Password" passwordLevel]);
    NSLog(@"Abcqsc123 --- %zd", [@"Abcqsc123" passwordLevel]);
    NSLog(@"ADgj123 --- %zd", [@"ADgj123" passwordLevel]);
    NSLog(@"ADgj246@ --- %zd", [@"ADgj246@" passwordLevel]);
    NSLog(@"Asdfgh169 --- %zd", [@"Asdfgh169" passwordLevel]);
    NSLog(@"Asdfgh010101 --- %zd", [@"Asdfgh010101" passwordLevel]);
    NSLog(@"Asdfgh20190401 --- %zd", [@"Asdfgh20190401" passwordLevel]);
    NSLog(@"Secret169!@# --- %zd", [@"Secret169!@#" passwordLevel]);
    NSLog(@"Secret1369@!#¥…… --- %zd", [@"Secret1369@!#¥……" passwordLevel]);

打印结果

2019-11-25 15:57:19.535470+0800 CCCheckPasswords[17302:105185] 111111 --- 0
2019-11-25 15:57:19.537895+0800 CCCheckPasswords[17302:105185] 123456 --- 0
2019-11-25 15:57:19.538161+0800 CCCheckPasswords[17302:105185] ababab --- 0
2019-11-25 15:57:19.538404+0800 CCCheckPasswords[17302:105185] abc123 --- 0
2019-11-25 15:57:19.538651+0800 CCCheckPasswords[17302:105185] 123abc --- 0
2019-11-25 15:57:19.538909+0800 CCCheckPasswords[17302:105185] password --- 0
2019-11-25 15:57:19.539164+0800 CCCheckPasswords[17302:105185] Password --- 0
2019-11-25 15:57:19.539376+0800 CCCheckPasswords[17302:105185] Abcqsc123 --- 1
2019-11-25 15:57:19.539618+0800 CCCheckPasswords[17302:105185] ADgj123 --- 1
2019-11-25 15:57:19.539862+0800 CCCheckPasswords[17302:105185] ADgj246@ --- 1
2019-11-25 15:57:19.540065+0800 CCCheckPasswords[17302:105185] Asdfgh169 --- 1
2019-11-25 15:57:19.540313+0800 CCCheckPasswords[17302:105185] Asdfgh010101 --- 1
2019-11-25 15:57:19.540496+0800 CCCheckPasswords[17302:105185] Asdfgh20190401 --- 2
2019-11-25 15:57:19.540735+0800 CCCheckPasswords[17302:105185] Secret169!@# --- 3
2019-11-25 15:57:19.541052+0800 CCCheckPasswords[17302:105185] Secret1369@!#¥…… --- 4

相关文章

网友评论

      本文标题:iOS 检测密码强度

      本文链接:https://www.haomeiwen.com/subject/quuniqtx.html