AoC/2015/days/04/md5.py

14 lines
210 B
Python
Raw Normal View History

2024-11-27 18:00:13 +01:00
#!/usr/bin/env python3
import hashlib
key = "yzbqklnj"
i = 0
while True:
result = hashlib.md5(f'{key}{i}'.encode())
if result.hexdigest().startswith("0"*6):
print(i)
break
i += 1