# Cocoa Maker 7 - Libraries and Frameworks

> Episode of [Cocoa Maker](https://podistic.com/podcast/cocoa-maker.md) · Published April 13, 2010

- **Listen on Podistic:** https://podistic.com/episode/cocoa-maker-7-libraries-and-frameworks
- **Video:** http://www.archive.org/download/CocoaMaker7-LibrariesAndFrameworks/CocoaMaker7.mp4 (video/mp4)

## About this episode

James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), and Nick, explains libraries and frameworks. 11:56 Example code from episode. Libraries Libraries included, /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib #import &lt;Foundation/Foundation.h&gt; #import &lt;openssl/evp.h&gt; int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString *string = @&quot;Hello&quot;; OpenSSL_add_all_algorithms(); unsigned char outbuf[EVP_MAX_MD_SIZE]; unsigned int templen, inlen = [string length]; const char *input = [string UTF8String]; EVP_MD_CTX ctx; const EVP_MD *digest = EVP_md5(); if(!digest) { NSLog(@&quot;cannot get digest with name MD5&quot;); return 1; } EVP_MD_CTX_init(&amp;ctx); EVP_DigestInit(&amp;ctx,digest); if(!EVP_DigestUpdate(&amp;ctx,input,inlen)) { NSLog(@&quot;EVP_DigestUpdate() failed!&quot;); EVP_MD_CTX_cleanup(&amp;ctx); return 1; } if (!EVP_DigestFinal(&amp;ctx, outbuf, &amp;templen)) { NSLog(@&quot;EVP_DigesttFinal() failed!&quot;); EVP_MD_CTX_cleanup(&amp;ctx); return 1; } EVP_MD_CTX_cleanup(&amp;ctx); NSMutableString *md5 = [NSMutableString string]; for (int i=0; i&lt;templen; i++) { [md5 appendFormat:@&quot;%x&quot;, outbuf[i]]; } NSLog(@&quot;MD5 of %@ is %@&quot;, string, md5); [pool drain]; return 0; } Frameworks Frameworks included, AddressBook.framework #import &lt;Foundation/Foundation.h&gt; #import &lt;AddressBook/AddressBook.h&gt; int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ABAddressBook *addressBook = [ABAddressBook sharedAddressBook]; NSArray *people = [addressBook people]; for (int i=0; i&lt;[people count]; i++) { ABPerson *person = [people objectAtIndex:i]; NSString *firstName = [person valueForProperty:kABFirstNameProperty]; NSString *lastName = [person valueForProperty:kABLastNameProperty]; NSString *name = nil; if (firstName!=nil) { name = firstName; if (lastName!=nil) name = [name stringByAppendingFormat:@&quot; %@&quot;, lastName]; } if (name!=nil) NSLog(@&quot;Person named: %@&quot;, name); } [pool drain]; return 0; } Keynote used in this Episode Keynote in PDF Format
