Re: ssl.h linking error
Re: ssl.h linking error
- Subject: Re: ssl.h linking error
- From: Jon Shier <email@hidden>
- Date: Fri, 26 May 2006 20:12:28 -0500
I know you've solved your problem, but I thought I'd make a
suggestion. Now, this may not be suitable for whatever type of app
you're creating, but there is a CommonCrypto library as part of the
10.4 SDK. This has a header, CommonDigest.h, that has some easy
functions for various hashes, including SHA1. I use it in the
following way:
#import <CommonCrypto/CommonDigest.h>
- (NSData *) hashFileData: (NSData *) fileData withRange: (NSRange)
range {
CC_SHA1_CTX sha1Context;
unsigned char hash[20];
CC_SHA1_Init(&sha1Context);
CC_SHA1_Update(&sha1Context, [[fileData subdataWithRange: range]
bytes], range.length);
CC_SHA1_Final(hash, &sha1Context);
return [NSData dataWithBytes: hash length: 20];
}
It should be fairly straight forward to figure out the usage from my
example, and by looking at the CommonDigest.h file.
Jon Shier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden