Objective-C port of Dan Palmer's jQuery Complexify plugin. It powers Padlock.
"Complexify aims to provide a good measure of password complexity for websites apps to use both for giving hints to users in the form of strength bars security level, and for casually enforcing a minimum complexity for security reasons."
Computing password complexity in the main queue
+ (void)checkComplexityOfPassword:(NSString *)password completionHandler:(ComplexifyCallback)completionHandler;
[Complexify checkComplexityOfPassword:@"foobar"
completionHandler:^(BOOL valid, CGFloat complexity){
/*
valid :
BOOL
YES | NO
complexity :
CGFloat
0 <= complexity <= 100
*/
}];
}];Computing password complexity in the background queue (callback block will be in the main queue)
+ (void)checkComplexityInBackgroundOfPassword:(NSString *)password completionHandler:(ComplexifyCallback)completionHandler;
[Complexify checkComplexityInBackgroundOfPassword:@"foobar"
completionHandler:^(BOOL valid, CGFloat complexity){
/*
valid :
BOOL
YES | NO
complexity :
CGFloat
0 <= complexity <= 100
*/
}];
}];