I need to add the URL of a 3rd-party website to a url, but I'd like to compress/obfuscate the host part. Are there any algorithms I can use which will hash the url, but also allow un-hashing?
For example; the url is http://www.twitter.com/myusername
. What I'm serving currently (as a html link) is http://mysite.net/bounce/www.twitter.com/username
. What I'd like to serve is something like http://mysite.net/bounce/X5nsSkdWfA/username
, and have the bounce script decode |^/bounce/(.*)/|
back to www.twitter.com
.
I'd like to do this without storing the hash anywhere.
Suggestions?