Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys,getopt,string,random
- def makehash(inp,charset=string.digits + string.ascii_letters):
- out = 0;
- for x in inp:
- out *= len(charset) + 1
- try:
- out += charset.index(x) + 1
- except:
- pass
- return hex(out)
- def makestring(inp, charset=string.digits + string.ascii_letters):
- inp = int(inp,16)
- out = ''
- while inp > 0:
- y = inp % (len(charset) + 1)
- if y > 0:
- out = charset[y - 1] + out
- else:
- out = ' ' + out;
- inp = (inp - y) / (len(charset) + 1)
- return out
- def strip(str,char):
- out = ''
- for c in str:
- if c != char:
- out += c
- return out
- def makecharset(inp):
- out = ''
- while len(inp) > 0:
- rem = inp[int(random.random() * (len(inp)) - .01)]
- out += rem
- inp = strip(inp,rem)
- return out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement