Here the puzzle is to find a number that will generate an MD5 hash with five zeroes if added to a “secret key.” The “secret key” is the puzzle input. The examples are shown in the description are:
- Key: abcdf, Number: 609043. The MD5 hash: 000001dbbfa…
- Key: pqrstuv, Number: 1048970, The MD5 hash: 000006136ef….
This time, I didn’t try to find the “immutable” solution, and I use a var on the function to calculate the number. In addition to that, it is very straightforward counting on MD5 Java implementation:
The second part is doing the same, but finding the number to have six zeroes on the hash:
You can find this code along with my input and puzzle answers at here.