http://qs1969.pair.com?node_id=1014697


in reply to Re^2: Using filepath method to identify an .html page
in thread Using filepath method to identify an .html page

Why don't you create a database table with two columns. One column is "the string", and the other column is a unique integer. Most databases have an almost inexhaustible supply of unique integers for such columns.

  • Comment on Re^3: Using filepath method to identify an .html page

Replies are listed 'Best First'.
Re^4: Using filepath method to identify an .html page
by Nik (Initiate) on Jan 22, 2013 at 15:48 UTC
    Integers need to be created on the fly when an html file is being requested.
    I just tried:
    pin = int( htmlpage.encode("hex"), 16 )
    but that also fails.

    The number needs to be a 4-digit integer only, if its to be stored in the database table correctly. So hex encoding is not usefull here.

      I did not mention a "hex encoding" anywhere in my reply. I suggest you actually read my reply, and use a database, or a "key value store", and build a map of words to numbers.

      A reply falls below the community's threshold of quality. You may see it by logging in.