2đź‘Ť
You can go with url compression + encrypting/base64 approach.
For compressing you can check python’s zlib or any other lossless compression libraries (lzma, etc), then convert compressed binary string to ascii by base64. For your information, zlib + base64 for your url is worse than the original url.
But the url may never be as short as you expect, simply because the url content have a lot of information, bad compression ratio, etc. So it’s possible that this solution will never meet the need for applications with text length limit (like twitter).
So If you wanna a REALLY short url, there must be somewhere to store the short-long pair.
Keeping those in mind, and I googled for “url shortener” and a lot popped out.
These are third party web applications just to do this job:
- http://goo.gl/ from google
- http://app.x.co/ my first search hit
- http://www.appappeal.com/apps/url-shortener a massive list of shortener apps
- goo.gl/zyHmS well, I’m just trying goo.gl out
…
Hope you can use a third party app, though.