Using filepath method to identify an .html page

Ferrous Cranus nikos.gr33k at gmail.com
Tue Jan 22 13:02:26 CET 2013


# ====================================================================================================================================
# produce a hash string based on html page's filepath and convert it to an integer, that will then be used to identify the page itself
# ====================================================================================================================================

pin = int( hashlib.md5( htmlpage ) )

This fails. why?

htmlpage = a string respresenting the absolute path of the requested .html file
hashlib.md5( htmlpage ) = conversion of the above string to a hashed string
int( hashlib.md5( htmlpage ) ) = conversion of the above hashed string to a number

Why this fails?



More information about the Python-list mailing list