Friday, June 3, 2011

URL shortener algorithm

Here is a simple hashing algorithm that generates a short string for a given ID. This can be used for example in an URL shortener where you store the full URL under an ID and use this algorithm to generate a sort string to reference that ID.

more on that on stackoverflow or on


  1. Thanks for sharing this, it appears is exactly what I'm looking for. However, I would like to pass a 32 character alpha-numeric string, get a shortened string, and then convert the shortened string back to the original. This example returns numbers that I'm not sure what they mean. How can I use this to get strings matching the criteria I listed above?

    1. Great Article Image Processing Projects Deep Learning Projects for Final Year JavaScript Training in Chennai JavaScript Training in Chennai The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai

  2. Did you know you can create short urls with AdFly and make cash for every click on your shortened urls.

  3. Great! It sounds good. Thanks for sharing..

  4. There are some URL shorteners that will empower the customization of wanted URL inside the way that you just would have the capacity to hold the catchphrases that are utilized for that correct page. link shortener

  5. There are many individuals as yet utilizing their site URL to publicize or link to their business page.url shortener