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 snook.ca

4 comments:

  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?

    ReplyDelete
  2. Great! It sounds good. Thanks for sharing..
    Shortener

    ReplyDelete
  3. 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

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

    ReplyDelete