drifter Posted December 20, 2006 Share Posted December 20, 2006 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 More sharing options...
steelmanronald06 Posted December 20, 2006 Share Posted December 20, 2006 In a database? I thought a normal VARCHAR field could go up to 255 and from there you had to use TEXT and Blob Link to comment https://forums.phpfreaks.com/topic/31320-string-lenght-and-md5/#findComment-144921 Share on other sites More sharing options...
drifter Posted December 20, 2006 Author Share Posted December 20, 2006 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.