Re:Show HN: Shortern URIs using Huffman Coding, not a database
by zzzcpan on Tuesday May 02, 2017 @01:00PM
(#14248155)
The idea is still interesting. I imagine using some dictionary based compression and crawled data to build a dictionary could get us somewhere.
[ Parent
| on HN ]
Re:Show HN: Shortern URIs using Huffman Coding, not a database
by grey-area on Tuesday May 02, 2017 @07:04PM
(#14251498)
Unfortunately the longest urls, the ones you want to shorten the most, are the worst candidates for compression (with long query strings full of things like uuids).
Re:Show HN: Shortern URIs using Huffman Coding, not a database
by 19eightyfour on Tuesday May 02, 2017 @11:24PM
(#14252780)
I have an idea to identify the uuid and other identifier type parts and encode them up as numbers. The file radix_coder.js is working toward this. So we cover a few formats like guid base64 digits base36, to get a little bit more gain.
But my initial experiments suggest it's just a little gain. Digits go to 68%, base36 to 90%, and then we also have to add in the prefix to indicate we are switching encodings.
Re:Show HN: Shortern URIs using Huffman Coding, not a database
by usgroup on Tuesday May 02, 2017 @01:42PM
(#14248636)
That's basically what a Huffman code is. Once you have a big list of examples, it's just a way to encode it to take advantage of frequency of occurrence.
Re:Show HN: Shortern URIs using Huffman Coding, not a database
by ciphre on Tuesday May 02, 2017 @05:18PM
(#14250718)
If it were to use a dictionary that defines a large subset of domain names and common strings found in URLs it could reduce the size somewhat more, but still seems too long to be viable. What might be more interesting is an Ethereum approach to URL shortening that is distributed amongst the Internet.