from hashlib import md5


def part2_adventcoin_miner(secret_key, match='000000'):
    """
    --- Part Two ---
    Now find one that starts with six zeroes.
    """
    for x in range(99999999):
        newkey = md5(secret_key + str(x)).hexdigest()
        if newkey[:len(match)] == match:
            return (x)