• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ssl.h linking error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >ssl.h linking error (From: dancedrummer <email@hidden>)

  • Prev by Date: NSFileManager currentDirectoryPath returning nil
  • Next by Date: Separators in NSPopUpButton via bindings
  • Previous by thread: Re: ssl.h linking error
  • Next by thread: Re: ssl.h linking error
  • Index(es):
    • Date
    • Thread