Advent Of Code 2016 - Day 5 solution commented

The problem

The original problem, with an amusing tale for motivation can be found here. For the purposes of this it is sufficient to know the following:

You arrive at a password protected door with ID ‘uqwqemis’.

The eight-character password for the door is generated one character at a time by finding the MD5 hash of some Door ID (the puzzle input) and an increasing integer index (starting with 0).