Skip to content

Instantly share code, notes, and snippets.

@csexton
Forked from cupakromer/Compiling
Created December 19, 2012 18:53
Show Gist options
  • Save csexton/4339346 to your computer and use it in GitHub Desktop.
Save csexton/4339346 to your computer and use it in GitHub Desktop.
Compile with `gcc -Wall -lssl -lcrypto shait.c`
#include <stdio.h>
#include <openssl/sha.h>
int main(int argc,char **argv)
{
SHA256_CTX context;
unsigned char md[SHA256_DIGEST_LENGTH];
SHA256_Init(&context);
SHA256_Update(&context, "hello world", 11);
SHA256_Final(md, &context);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment