summaryrefslogtreecommitdiff
path: root/the-ideal-stocking-stuffer/README.org
blob: 8e1edb83c1f3ca26f1762592f47310090a25b2a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
See: https://adventofcode.com/2015/day/4
** Part 1
*** Purpose
The idea is simple. Given a key:

#+begin_example
iwrupvqb
#+end_example

Append an integer to it, starting from 0:

#+begin_example
iwrupvqb0
#+end_example

And run it through the [[https://en.wikipedia.org/wiki/MD5][MD5 hash function]]. When the result starts with "00000", return that number!

*** Method

The algorithm is given to us. Simply implement MD5, and an environment that will allow us to brute-force test various keys.

** Part 2
*** Purpose
Part two asks us to do the same thing---but look for a different output. Instead of five zeros in the resultant hash, we want six! By making this a variable, we can now look for any output!

Beware, the more specific the desired output, the longer it takes to find!