Trending
Global Youth Competition on Influenza and COVID-19 Prevention and Control is trending now Nigeria: Donor Cuts, Govt Inaction Push HIV Patients Towards Death, Uncertainty in Rivers… is trending now Grant Competition for Non-Governmental HIV Service Organizations (Ukraine) is trending now Ebola Outbreak in DRC Hits Livelihoods and Healthcare Access is trending now Partial lunar eclipse live: Latest news, viewing tips and live updates from Aug. 27-28 ec… is trending now Transfer latest: Konsa, Jones & Baleba updates plus reporter Q&A is trending now Ballon d’Or 2026: Three players ahead of Harry Kane to win award – Didi Hamann is trending now 'A leap in quality' - Diego Simeone praises substitutes as Atletico Madrid open La Liga c… is trending now Mikel Arteta Sends Warning Ahead of Arsenal's Premier League Title Defense is trending now Open Call: Socially Engaged Art Support Grant FY2027 is trending now 'We were dating same girl' - Blaqbonez finally reveals cause of feud with Odumodublvck [V… is trending now FULL LIST: Burna Boy, Tems make 2026 MTV VMA nominees list is trending now Global Youth Competition on Influenza and COVID-19 Prevention and Control is trending now Nigeria: Donor Cuts, Govt Inaction Push HIV Patients Towards Death, Uncertainty in Rivers… is trending now Grant Competition for Non-Governmental HIV Service Organizations (Ukraine) is trending now Ebola Outbreak in DRC Hits Livelihoods and Healthcare Access is trending now Partial lunar eclipse live: Latest news, viewing tips and live updates from Aug. 27-28 ec… is trending now Transfer latest: Konsa, Jones & Baleba updates plus reporter Q&A is trending now Ballon d’Or 2026: Three players ahead of Harry Kane to win award – Didi Hamann is trending now 'A leap in quality' - Diego Simeone praises substitutes as Atletico Madrid open La Liga c… is trending now Mikel Arteta Sends Warning Ahead of Arsenal's Premier League Title Defense is trending now Open Call: Socially Engaged Art Support Grant FY2027 is trending now 'We were dating same girl' - Blaqbonez finally reveals cause of feud with Odumodublvck [V… is trending now FULL LIST: Burna Boy, Tems make 2026 MTV VMA nominees list is trending now
Technology

Compress Links For Optimal QR Codes

Compress Links For Optimal QR Codes

Link shorteners have been a staple of the online world for over two decades now, but they’ve got some issues– for one thing, it’s totally non-transparent where the link actually …read more

Link shorteners have been a staple of the online world for over two decades now, but they’ve got some issues– for one thing, it’s totally non-transparent where the link actually goes, leaving you open to all sorts of shenanigans, of which RickRolling is probably the best case. For two, your traffic is going through an external service who may have their own nefarious intent. [PortalRunner] had an idea: don’t shorten the link, but compress it.

You see, a traditional URL shortener like tinyurl just generates a random code and associates that with your original link in its database. That’s fine, but you’re relying on a third party database. The alternative is to take the URL, encode it in some way, and apply some compression algorithm to the data. If the encoding and compression are open-source– which [Portal ]’s absolutely are— then you can check yourself before following the link, and/or self-host the whole thing for piece of mind. As a bonus [Portal]’s Ha.mr– that’s pronounced Hammer– also gives you a QR code optimized for easy scanning. QR codes have a specific alphanumeric character set built in, and it isn’t the full UTF-8– if you naively use random text, you’re in byte mode, which needs a lot more QR real estate. Or inverting that, the fewer bits it has to store, the easier a qr code is to scan at the same size. The text version of the compressed links can use UTF-8– including emoticons– but they don’t have to.

The whole project has a “why isn’t everyone doing it this way” vibe about it. We’d probably want to self-host this if we were using it seriously– [Portal] put this together on a lark and makes no promises it will be online forever–but again, this is open source, so we can. [Portal] is using normal compression algorithms here, but if you really want to squeeze text, use a neural net. 

View original source →

Related

More from Hackaday Blog