Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def unhash(hash,charset=string.digits + string.ascii_letters):
- z = len(charset) + 1
- y = hash%z
- out = charset[y-1] if y > 0 else ' '
- return out if hash == y else unhash((hash-y)/z,charset) + out
- def unhash(inp, charset=string.digits + string.ascii_letters):
- x = len(charset) + 1
- inp = int(inp,16)
- out = ''
- while inp > 0:
- y = inp%x
- out = (' ' if y == 0 else charset[y-1])+out
- inp = (inp-y)/x
- return out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement