repl.it
@anonymous/

DeliriousRowdyDairycow

Python 2.7

No description

fork
loading
Files
  • main.py
main.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
pw_charset='abcdefghijkmnpqrstuvwxyz23456789#%+=?'

    
def pwgen(x):
	x*=2**32+2
	x=int(float(x))
	pw=''
	for n in range(0,12):
		rem=x%37
		pw=pw_charset[rem]+pw
		x/=37
	return pw

def pw_to_candidate_ints(x):
    val=0
    l=len(x)
    for n in range(0,l):
            val+=pw_charset.find(x[n])*(37**(11-n))
    cands=range(val/0x100000002, (val+37**(12-l))/0x100000002+1)
    val+=37**12
    cands+=range(val/0x100000002, (val+37**(12-l))/0x100000002+1)
    return [y for y in cands if pwgen(y)[:l]==x]

candidates=pw_to_candidate_ints('b=+#gc5q')
for x in candidates:
    print '%x' % x, pwgen(x)