2015 day 4 part 1 & 2

This commit is contained in:
Xevion
2019-11-22 23:21:30 -06:00
parent bc36899a09
commit e773a17fc2
2 changed files with 17 additions and 0 deletions

1
2015/day-4/input Normal file
View File

@@ -0,0 +1 @@
bgvyzdsv

16
2015/day-4/python/main.py Normal file
View File

@@ -0,0 +1,16 @@
import os
import sys
import hashlib
PATH = os.path.join(sys.path[0], '..', 'input')
SALT = 'bgvyzdsv'
md5 = hashlib.md5()
i = 0
while True:
md5.update((SALT + str(i)).encode())
if md5.hexdigest().startswith('00000'):
print(i)
break
i += 1