Create a URL, e.g. by submitting one through the form on the home page. Once it’s in the system, we will redirect requests for any unambiguous prefix of that URL’s hash to the URL itself; for instance, this URL goes to a random file in one of my GitHub repositories:
Note the /1
at the end of that link. If you’re using short
prefixes, then it’s quite likely that at some point, someone is going
to upload a URL that coincidentally (or deliberately!) shares a prefix
with the URL you uploaded. To guard against this possibility, you can
use a number n after your prefix to say “I want the
nth URL in the list of URLs that share this prefix.” This
server remembers what order URLs got submitted in, and it always shows
lists of URLs for a given prefix in the same order, so URLs with a
number like that in them should be stable links.
When you submit a URL, we take the SHA-2 hash of that URL
and store it in a database pointing to that URL. We store it in such a way
that finding the URL for any given hash prefix is easy, so when you look
up a prefix, we can find all the URLs that match that prefix. If only one
URL matches, then we serve an HTTP redirect to that
URL. If more than one URL matches, we serve a disambiguation page (using
the rarely used HTTP
300 Multiple Choices status) that points to each of the possible
URLs. If you pass in a slot number (like that /1
above), we
translate that into an index in the list of URLs for that prefix.
Most link shorteners just come up with a number for your URL on the spot. Maybe they roll some dice. Maybe they have a counter. They then store that number in a database somewhere, and that number becomes your short link.
The problem with this approach is that if those services ever go away or their database gets lost, so does all information about which short links referred to which destination URLs. This means any time you come across a short link from that service, the trail goes dead; there’s no way to guess what that link could have referred to.
(N.B. the services don’t need to completely die for this to be a problem; even today some of them will show you pretty aggressive interstitial ads before they allow you to see where a link goes.)
With this service on the other hand, as long as you have a list of all of the source URLs, you can figure out by hashing those URLs which SHA links referred to which source URL. (Constructing that list is a challenge in and of itself, but it’s a more tractable challenge; e.g. a site could publish this list somewhere as a bibliography, and then use 5- or 6-digit SHA links everywhere else.)
/1
thing
have the same problem?The slot number after a SHA link does secretly work the same way as other link shorteners; it’s server-side information about which URL goes where. If this service ever goes away, the slot numbers stop meaning anything.
This, however, creates a much smaller problem: for a 5-digit prefix (the shortest we allow), the set of possible input links is still reduced by a factor of about a million. If you still don’t like those odds, you can use a longer prefix; at 7 characters, you’re down to one in 268 million links. At 8 characters, you’re at 4 billion.
Good question. For starters, here are some things we don’t support:
If you think this site is causing harm somehow, please do not hesitate to contact us. However note that the bar for content getting removed is higher than mere disapproval—and that goes for our disapproval as well as yours. E.g., one use for a site like this might be to gather links to odious content for use in an article about what not to do.