Today's Menu  Portugal
journal and plan nutrition
Instance Methods | List of all members
NSString(MD5) Category Reference

#import <NSString+MD5.h>

Instance Methods

(NSString *) - generateMD5Hash
 

Detailed Description

Definition at line 11 of file NSString+MD5.h.

Method Documentation

◆ generateMD5Hash()

- (NSString *) generateMD5Hash

Definition at line 13 of file NSString+MD5.m.

14 {
15  const char *string = [self UTF8String];
16  unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];
17  CC_MD5(string, (unsigned int)strlen(string), md5Buffer);
18  NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
19  for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
20  [output appendFormat:@"%02x",md5Buffer[i]];
21  return output;
22 }

The documentation for this category was generated from the following files: