[Answered ]-How to create short urls without having database

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:

Hope you can use a third party app, though.

👤tdihp

Leave a comment