Skip to content Skip to sidebar Skip to footer

Lossless Compression Method To Shorten String Before Base64 Encoding To Make It Shorter?

just built a small webapp for previewing HTML-documents that generates URL:s containing the HTML (and all inline CSS and Javascript) in base64 encoded data. Problem is, the URL:s q

Solution 1:

Check out this answer. It mentions functions for LZW compression/decompression (via http://jsolait.net/, specifically http://jsolait.net/browser/trunk/jsolait/lib/codecs.js).

Solution 2:

You will struggle to get very much compression at all on a URL, they're too short and don't contain enough redundant information to get much benefit from Huffman / LZW style algorithms.

If you have constraints on the space of possible URLS (e.g. all content tends to be in the same set of folders) you could hard code some parts of the URLS for expansion on the client - i.e. cheat.

Post a Comment for "Lossless Compression Method To Shorten String Before Base64 Encoding To Make It Shorter?"