Ajout des 2 parties
This commit is contained in:
parent
914adeebbc
commit
cb37874d42
1 changed files with 29 additions and 0 deletions
29
jour04/run.py
Normal file
29
jour04/run.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
myInput = "iwrupvqb"
|
||||||
|
i = 1
|
||||||
|
find = False
|
||||||
|
md = None
|
||||||
|
|
||||||
|
print("Traitement de la partie 1…")
|
||||||
|
|
||||||
|
while not find:
|
||||||
|
md = hashlib.md5((myInput + str(i)).encode("utf-8"))
|
||||||
|
if md.hexdigest()[0:5] == "00000":
|
||||||
|
find = True;
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
print(i)
|
||||||
|
|
||||||
|
print("Traitement de la partie 2…")
|
||||||
|
|
||||||
|
find = False
|
||||||
|
while not find:
|
||||||
|
md = hashlib.md5((myInput + str(i)).encode("utf-8"))
|
||||||
|
if md.hexdigest()[0:6] == "000000":
|
||||||
|
find = True;
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
print(i)
|
Loading…
Reference in a new issue