Last active
October 3, 2018 04:15
-
-
Save khanzf/956f84b7309c181aff0d03e7f359b4a1 to your computer and use it in GitHub Desktop.
SHA1 on BSD
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
// Compiled on BSD with cc shatest.c -o shatest -lmd | |
#include <sys/types.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <sha.h> | |
#define HEX_DIGEST_LENGTH 257 | |
int | |
main() { | |
SHA1_CTX context; | |
char buf[HEX_DIGEST_LENGTH]; | |
unsigned char buffer[] = "bismillah"; | |
SHA1_Init(&context); | |
SHA1_Update(&context, buffer, strlen(buffer)); | |
printf("%s\n", SHA1_End(&context, buf)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment