Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import time
- def wheelCombine(wheels, elements):
- idx = [0] * wheels
- lim = len(elements)
- com = open('wcom.txt', 'w')
- tmp = ''
- cnt = 0
- while(True):
- for i in idx:
- tmp += elements[i]
- tmp = tmp+"\n"
- cnt += 1
- if (cnt % 65536) == 0:
- com.write(tmp)
- tmp = ''
- print("Writing block!. "+str(cnt))
- idx[wheels - 1] += 1
- for i in range(wheels - 2, -1, -1):
- if idx[i+1] == lim:
- idx[i+1] = 0
- idx[i] += 1
- if idx[0] == lim:
- break
- com.write(tmp)
- com.close()
- return cnt
- te = time.time()
- cnt = wheelCombine(8, ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'])
- te = time.time()-te
- print(str(cnt) + " Keys generated. Time elapsed: " + str(te) +" sec.")
Advertisement
Add Comment
Please, Sign In to add comment