Jump to content

string lenght and MD5


drifter

Recommended Posts

OK I have a long string that is really a bunch of characters to identify a query. It will range from 20 characters up to about 100 characters.

The problem is that I can not use a string longer then 64 characters, so I want find a way to shorten it and keep them unique so truncating is out.

I had the idea to md5() them - that returns a fixed 32 characters right? Obviously a md5 is a finite number of characters, so there will be repeats, but I do not have to worry about that with 100 characters right?

is there a better way to do this?

Thanks
Link to comment
https://forums.phpfreaks.com/topic/31320-string-lenght-and-md5/
Share on other sites

actually it is part of a filename for caching a query result. I can save the long string in the DB and generate a guid for the file name, but then that is just an extra step I need to take and I am working on speeding up things and eliminating steps.
Link to comment
https://forums.phpfreaks.com/topic/31320-string-lenght-and-md5/#findComment-144923
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.