Advertisement
imk0tter

Imk0tter

Nov 19th, 2010
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. def unhash(hash,charset=string.digits + string.ascii_letters):
  2.     z = len(charset) + 1
  3.     y = hash%z
  4.     out = charset[y-1] if y > 0 else ' '
  5.     return out if hash == y else unhash((hash-y)/z,charset) + out
  6.  
  7. def unhash(inp, charset=string.digits + string.ascii_letters):
  8.     x = len(charset) + 1
  9.     inp = int(inp,16)
  10.     out = ''
  11.     while inp > 0:
  12.         y = inp%x
  13.         out = (' ' if y == 0 else charset[y-1])+out
  14.         inp = (inp-y)/x
  15.     return out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement