all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
18
Task/SHA-1/C/sha-1.c
Normal file
18
Task/SHA-1/C/sha-1.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
unsigned char result[SHA_DIGEST_LENGTH];
|
||||
const char *string = "Rosetta Code";
|
||||
|
||||
SHA1(string, strlen(string), result);
|
||||
|
||||
for(i = 0; i < SHA_DIGEST_LENGTH; i++)
|
||||
printf("%02x%c", result[i], i < (SHA_DIGEST_LENGTH-1) ? ' ' : '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue