diff -r d84d25d6cdbb -r 8fad19466c59 Base64.m --- a/Base64.m Sat Mar 08 21:04:41 2008 -0800 +++ b/Base64.m Sun Apr 06 19:13:27 2008 -0700 @@ -10,11 +10,13 @@ // #import "Base64.h" + +//NOTE: Using this requires linking against /usr/lib/libcrypto.dylib. #import #import -@implementation NSData (Base64) +@implementation NSData (MYBase64) /** @@ -24,9 +26,9 @@ * Code courtesy of DaveDribin (http://www.dribin.org/dave/) * Taken from http://www.cocoadev.com/index.pl?BaseSixtyFour **/ -- (NSString *)base64String +- (NSString *)my_base64String { - return [self base64StringWithNewlines: YES]; + return [self my_base64StringWithNewlines: YES]; } /** @@ -36,7 +38,7 @@ * Code courtesy of DaveDribin (http://www.dribin.org/dave/) * Taken from http://www.cocoadev.com/index.pl?BaseSixtyFour **/ -- (NSString *)base64StringWithNewlines:(BOOL)encodeWithNewlines +- (NSString *)my_base64StringWithNewlines:(BOOL)encodeWithNewlines { // Create a memory buffer which will contain the Base64 encoded string BIO * mem = BIO_new(BIO_s_mem()); @@ -61,12 +63,12 @@ return base64String; } -- (NSData *)decodeBase64 +- (NSData *)my_decodeBase64 { - return [self decodeBase64WithNewLines:YES]; + return [self my_decodeBase64WithNewLines:YES]; } -- (NSData *)decodeBase64WithNewLines:(BOOL)encodedWithNewlines +- (NSData *)my_decodeBase64WithNewLines:(BOOL)encodedWithNewlines { // Create a memory buffer containing Base64 encoded string data BIO * mem = BIO_new_mem_buf((void *) [self bytes], [self length]); @@ -90,7 +92,7 @@ } -- (NSString *)hexString +- (NSString *)my_hexString { const UInt8 *bytes = self.bytes; NSUInteger length = self.length; @@ -102,7 +104,7 @@ autorelease]; } -- (NSString *)hexDump +- (NSString *)my_hexDump { NSMutableString *ret=[NSMutableString stringWithCapacity:[self length]*2]; /* dumps size bytes of *data to string. Looks like: