day4: part 1 and 2 with python

This commit is contained in:
Samuel Ortion 2024-11-27 18:00:13 +01:00
parent e8ca549ac5
commit 45277d41f5
Signed by: sortion
GPG Key ID: 9B02406F8C4FB765
1 changed files with 13 additions and 0 deletions

13
2015/days/04/md5.py Normal file
View File

@ -0,0 +1,13 @@
#!/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