Just a quick note...
The problem asks us to "[Encode] a URL to a shortened URL" and to "[Decode] a shortened URL to its original URL". But almost all solutions so far encode to something like
"4e9iAk". Those aren't URLs. Trivial to fix, of course.
@StefanPochmann ooh Mine does that. :D