php - Generate a unique tinyurl-like ID but randomly (not mysql row id to base64) -


i need generate unique url tinyurl's: domain.com/pgdzs7, domain.com/ab4dh3 (!) problem don't want users have possibility view previous , next urls changing last letters in url.

for example, if creates content gets url domain.com/pgdzs7, want next visitor absolutely different unique url (for example, "ab4dh3") nobody can't find out how these urls have been generated , see content of other users unless know url.

all found here on stackoverflow convert table's primary integer key base64 form. need different solution not generate collisions , doesn't have for/while cycles (if it's possible) since mysql table has dozens of gbytes.

you can make formula next index. like: lastid*2+5

you won't have colisions or loops check if id used before.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -