As far as I am aware, the standard implementation of a URL shortening algorithm is to convert the number to a higher base, not to generate a random string. This has the advantages of greater loading speed, and smaller storage size.
Here is one I wrote long enough ago for me to be divorced from its implementation flaws: https://github.com/TShadwell/go-shorten/blob/master/shorten/...