-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfull.py
39 lines (32 loc) · 1002 Bytes
/
full.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from time import time
from constants import *
from reverse.split import *
def reverse21(options):
options_next = []
for r3o in options:
r2 = reverse2(r3o) # unique result
options_next += reverse1(r2) # yields list of options
return options_next
def reverse(output):
for start_option, r3 in enumerate(reverse3(output)):
options = {bytes(r3)}
for round in range(ROUNDS):
options = reverse21(options)
if not options:
break
# else:
# print(start_option, round, len(options))
if options:
yield options
if start_option > (1 << 14):
return
if __name__ == '__main__':
start = time()
for rev in reverse(TARGET):
print(rev)
"""for o in reverse(target):
fwo = forward_full_a(o)
fwo_str = "".join([chr(i) for i in fwo])
print(o, "leads to", fwo_str)
"""
print("Execution time = ", time() - start)