Browse Source

Commiting 2015/day04/day04.c for backup

master
Brian Buller 3 years ago
parent
commit
57e8cd3a93
  1. 30
      2015/day04/day04.c

30
2015/day04/day04.c

@ -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;
}
Loading…
Cancel
Save