in reply to Compressing a string, but leaving it as a string

What's wrong with generating a random MD5 and living with the fact that you're going to be 32 chars long? That's a standard practice. It's not till you start to hit 2048 characters that you run into an IE bug, so use a few characters. It's not even your space you're wasting! :-)

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

  • Comment on Re: Compressing a string, but leaving it as a string

Replies are listed 'Best First'.
Re: Compressing a string, but leaving it as a string
by hacker (Priest) on Mar 11, 2005 at 21:02 UTC
    "What's wrong with generating a random MD5 and living with the fact that you're going to be 32 chars long?"

    A random MD5 doesn't help, because I can't take that MD5 string and reverse it back to the original tokens.

      Use the MD5 as a key into a DB file on the server side that has the real data saved using Storable or YAML.