You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
521 B

#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;
}