first commit
This commit is contained in:
23
04/part01.py
Normal file
23
04/part01.py
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import hashlib
|
||||
import re
|
||||
|
||||
|
||||
def main():
|
||||
number = 0
|
||||
input = "yzbqklnj"
|
||||
|
||||
while True:
|
||||
s = "%s%d" % (input, number)
|
||||
m = hashlib.md5()
|
||||
m.update(s)
|
||||
h = m.hexdigest()
|
||||
if re.match(r'^(0){5}', h):
|
||||
print number
|
||||
print h
|
||||
break
|
||||
number = number + 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
23
04/part02.py
Normal file
23
04/part02.py
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import hashlib
|
||||
import re
|
||||
|
||||
|
||||
def main():
|
||||
number = 0
|
||||
input = "yzbqklnj"
|
||||
|
||||
while True:
|
||||
s = "%s%d" % (input, number)
|
||||
m = hashlib.md5()
|
||||
m.update(s)
|
||||
h = m.hexdigest()
|
||||
if re.match(r'^(0){6}', h):
|
||||
print number
|
||||
print h
|
||||
break
|
||||
number = number + 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user