Converting a number back to it's original string (that was hashed to generate that number)

Ferrous Cranus nikos.gr33k at gmail.com
Wed Jan 23 13:21:55 CET 2013


Now my website finally works as intended. Just visit the following links plz. 
------------------------------------------------------------------------------ 
1. http://superhost.gr 

2. http://superhost.gr/?show=log 

3. http://i.imgur.com/89Eqmtf.png  (this displays the database's column 'pin', a 5-digit number acting as a filepath indicator) 

4. http://i.imgur.com/9js4Pz0.png   (this is the detailed html page's information associated to 'pin' column indicator instead of something like '/home/nikos/public_html/index.html' 

Isn't it a nice solution? 

I beleive it is.

but what happens when:   http://superhost.gr/?show=stats

I just see the number that correspons to a specific html page and hence i need to convert that number back to its original string.

# ==========================================================
# generating an 5-digit integer based on filepath, for to identify the current html page
# ==========================================================

pin = int( htmlpage.encode("hex"), 16 ) % 100000

Now i need the opposite procedure. Will hex.decode(number) convert back to the original string?

I think not because this isnt a hash procedure.
But how can it be done then?



More information about the Python-list mailing list