Skip to content

Instantly share code, notes, and snippets.

@laanlabs
Created April 28, 2011 03:56
Show Gist options
  • Save laanlabs/945769 to your computer and use it in GitHub Desktop.
Save laanlabs/945769 to your computer and use it in GitHub Desktop.
unsigned char result[CC_SHA256_DIGEST_LENGTH];
CC_SHA256([input bytes], [input length], result);
NSMutableString *output = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_SHA256_DIGEST_LENGTH; i++)
[output appendFormat:@"%02x",result[i]];
NSLog(@"sig: %@", output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment