summary refs log tree commit diff stats
path: root/day4.py
blob: ab2bb88c08168355dfa5573a8c59b88ceea800ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python

from hashlib import md5

secret_key = r'iwrupvqb'

num = 1
while True:
    hashed = md5(str(secret_key + str(num)).encode('utf-8')).hexdigest()
    if hashed[:5] == '00000':
        print(num)
        break
    num += 1

num = 1
while True:
    hashed = md5(str(secret_key + str(num)).encode('utf-8')).hexdigest()
    if hashed[:6] == '000000':
        print(num)
        break
    num += 1