How do sites like tinyurl generate URLs?

I looked at tinyurl, tinypic, imgur and youtube! I thought they would use a text safe representation of the index and use it as the primary identifier in their database. However, an attempt to put the keys in Convert.FromBase64String (the "key") gives no results and throws an exception. Therefore, these sites do not use the base64 array. What do they use? What can I use if I were to do YouTube as a website or tinyurl?

+3
source share
3 answers

im, assuming they developed their own encoding, which is just the alphanumeric equivalent of the identifiers in their database. I am sure that they do not generate random strings simply because it will lead to catastrophic overflows at some point

+3
source

I don't know about TinyURL, Tinypic, etc., but shorl.com uses something called koremutake .

If I were to develop such a system, I would suggest that maybe some kind of short hash or simple random strings.

+2
source

I assume that they just generate a random string and use this as a primary key. I really see no reason to do anything else.

+1
source

Source: https://habr.com/ru/post/1716112/


All Articles