I looked at tinyurl, tinypic, imgur and youtube! I thought they would use a text safe representation of a index and use it as a primary ID in their DB. However trying to put the keys into Convert.FromBase64String("key") yields no results and throw an exception. So these sites dont use a base64 array. What are they using? What might i want to use if i were to do a youtube like site or tinyurl?
+1
A:
My guess is that they simply generate a random string and use that as the primary key. I don't really see a reason to do anything else.
ryeguy
2009-08-26 13:55:33
using a hash algorithm could also be a viable alternative, as it prevents storing the same thing twice. on the other hand, storage is dirt cheap these days, so I don't really know if that's necessary.
Can Berk Güder
2009-08-26 14:00:38
+2
A:
I don't know about TinyURL, Tinypic, etc. but shorl.com uses something called koremutake.
If I were to develop such a system, I guess some sort of short hash or plain random strings could be possible choices.
Can Berk Güder
2009-08-26 13:55:52