-
-
Save craigw/ce1e3d71646292a822d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (uint8_t *)SHA256; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Ezo Saleh on 04/12/2011. | |
// Any bugs added by Craig :) | |
// | |
#import "sha256.h" | |
-(uint8_t *) SHA256{ | |
const char *cstr = [self cStringUsingEncoding:NSUTF8StringEncoding]; | |
NSData *data = [NSData dataWithBytes:cstr length:self.length]; | |
uint8_t digest[CC_SHA256_DIGEST_LENGTH]; | |
CC_SHA256(data.bytes, data.length, digest); | |
return digest; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment