diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-04-10 13:50:25 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-04-10 13:50:25 +0800 |
commit | d4d515b2159dd50b76da060bfa11337bca04feed (patch) | |
tree | 335ada5afe1bab5c8b691d26e9cac0b38c2258f4 /src/2015/day4/aoc.cpp | |
parent | 3eab91520c4875ba7ec3ea61c3c544a0332bb082 (diff) | |
download | advent-of-code-d4d515b2159dd50b76da060bfa11337bca04feed.tar.gz advent-of-code-d4d515b2159dd50b76da060bfa11337bca04feed.zip |
md5 in common
Diffstat (limited to 'src/2015/day4/aoc.cpp')
-rw-r--r-- | src/2015/day4/aoc.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/2015/day4/aoc.cpp b/src/2015/day4/aoc.cpp index ab5f301..34693df 100644 --- a/src/2015/day4/aoc.cpp +++ b/src/2015/day4/aoc.cpp @@ -2,31 +2,6 @@ namespace aoc2015 { -char* md5sum(char* s) { - static char md5[64] = {0}; - uint8_t* x = md5String(s); - memset(md5, 0x0, 64); - for (auto i = 0; i < 16; i++) { - sprintf(md5 + i * 2, "%02x", x[i]); - } - return md5; -} - -int lead_zeros(char* s) { - char* p = s; - int total = 0; - while (*p != '\0') { - if (*p == '0') { - total += 1; - p++; - } - else { - break; - } - } - return total; -} - int day4(const char* secret, int target) { char buf[128] = {0}; int len = strlen(secret); |