RosettaCodeData/Task/SHA-256/C/sha-256.c
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

15 lines
268 B
C

#include <stdio.h>
#include <string.h>
#include <openssl/sha.h>
int main (void) {
const char *s = "Rosetta code";
unsigned char *d = SHA256(s, strlen(s), 0);
int i;
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
printf("%02x", d[i]);
putchar('\n');
return 0;
}