Objective-C port of Dan Palmer's Complexify
Objective-C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Complexify-ObjC.h
Complexify-ObjC.m
README.md

README.md

Complexify-ObjC

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."

Usage

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
                */
            }];

}];