Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

So, what you want is a function foo() and its inverse foo'() that does this:

foo( "some long string" )  -->  1234
foo'( 1234 ) --> "some long string"

Correct?

In other words, you want to keep the entire information content of the original string.

There are only two ways to do this:

  1. keep the original string, i.e. store it in a database of some sort, or
  2. lossless compression of the original string into a short number. While theoretically possible, the compression ratio you're asking for isn't going to be possible.

Which leaves the first option, as plenty of people here have described.

So: You've said you already have a database with a column that stores a 4-digit number. If that database table doesn't already have a column that stores the HTML page's absolute path, then add one. You'll also want a UNIQUE constraint on the column with the number (and/or the other column, depending on your database design). The rest is "just" SQL...


In reply to Re^7: Using filepath method to identify an .html page by Anonymous Monk
in thread Using filepath method to identify an .html page by Nik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-11-26 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?