I read about UUID v4 , and it is almost unique, and that is what I need. The problem is that this number is too large, is it possible to generate UUIDs like Facebook or Twitter with fewer characters?
I read a post where you can compress this code to 20 using Ascii85, but don’t see a reliable PHP script doing this job. Does anyone know a proven class? for a random ID, this is the best way to save this 20 char, right?
--- Edit ---
@ David Schwartz
Thanks. I need a random unique identifier on the same server, between 8 and 16 characters (ok 20 is great if it's the lowest). The idea is to identify objects with a readable identifier, but not increments (first object 10001, second 10002), method 542A4B243J, C63426KJ70, O30V4U1I9P, etc. In order. Identifiers are needed to be primary keys (at least) in 6 MySQL tables. Objects are created with PHP on the same server.
@ ta.speot.is
I wrote: “I don’t see a reliable PHP script doing the job. Does anyone know a proven class?” I don’t think that all codes appearing in google are tested, you tested all links, maybe?
@sarnold
Thank you, but I'm sorry I did not understand well = (
source share