Created
August 12, 2013 19:00
-
-
Save trevorsheridan/6213953 to your computer and use it in GitHub Desktop.
CocoaSecurity Base64 encoding example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <CocoaSecurity/CocoaSecurity.h> | |
- (NSString *)encodeUsername:(NSString *)username password:(NSString *)password | |
{ | |
CocoaSecurityEncoder *encoder = [[CocoaSecurityEncoder alloc] init]; | |
NSString *pair = [NSString stringWithFormat:@"%@:%@", username, password]; | |
return [encoder base64:[pair dataUsingEncoding:NSUTF8StringEncoding]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment