Commiting 2015/day04/day04.c for backup

This commit is contained in:
Brian Buller 2018-08-14 17:18:18 -05:00
parent de5c4ac25c
commit 57e8cd3a93

30
2015/day04/day04.c Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/md5.h>
void compute_md5(char *str, unsigned char digest[16]) {
MD5Context ctx;
MD5_Init(&ctx);
MD5_Update(&ctx, str, strlen(str));
MD5_Final(digest, &ctx);
}
void part1() {
unsigned char digest[16];
compute_md5("asdf", digest);
}
void part2() {
}
int main(int argc, char **argv) {
int doPart = 1;
if(argc > 1) { doPart = argv[1][0] - '0'; }
if(doPart == 1) {
part1();
} else {
part2();
}
return 0;
}