Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sortCharset(set):
- _set = ""
- for c in set:
- if c not in _set:
- _set += c
- set = _set
- del _set
- set = list(set)
- set.sort()
- return "".join(set)
- def stringForInt(num, set, length):
- setLen = len(set)
- string = ""
- string += set[num % setLen]
- for n in xrange(1,length):
- num //= setLen
- string += set[num % setLen]
- return string
- def bruteforce(set, length, raw = False):
- if raw is False:
- set = sortCharset(set)
- for n in xrange(len(set) ** length):
- yield stringForInt(n, set, length)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement