Another kind of link shortener

There are a lot of link shorteners out there right now. A surprising amount of them are owned by mercurial billionaires, and while this may or may not be that much of a problem on its own, when you combine it with the fact that these services generally destroy provenance on the links you upload—in that if the services ever go away, the link destinations become impossible to reconstruct—I at least start to have a problem with that.

So since I wanted to do some experiments with hand-written HTML, and I wanted to put some links in, and—for reasons unknown to me—sometimes people put things on the internet at URLs longer than 80 characters, I decided to go and make myself a link shortener. And I decided to make one that was at least a marginal improvement on this state of affairs.

This is what I came up with: you take the SHA-2 of your URL, and that becomes the short link. I know, I know, SHA-2s are pretty long. But good news, any prefix of that SHA-2 also works as a short link. And if someone else ever uploads a link that collides with yours, yours will still show up first in the list.

What you get out of this is the ability to at least confirm, if you have the link already, that the shortlink was to that link. The only missing step is to get at the set of possible input links, and that’s a tractable problem: e.g. a site could publish somewhere a list of the full links it uses, and then use 5- or 6-digit SHA-2 prefix links everywhere, and you’d always be able to figure out later where those short links led.

I should hastily add that this service is currently in alpha, so caveat non-emptor: I declare the right to modify or destroy the database to undo damage, or what I perceive as damage, at any time.

Go ahead and try it out: