i am looking for a way to make this hash shorter so that it can be written down quickly by hand My goal is to get a hash that is 6-8 characters long and then serve as url like:
www.myurl.de/10gherk
OK, now I know what you want to do:
If the redirection (from the short URL to the longer URL) is happening on your website, then that means you will need to create a web routine to do that redirection in the first place.
And while you are already writing code for your website (to do the redirection), you might as well complete the circle and add a routine that generates the shorturl's yourself.
For example, create a webservice maybe like this:
GenShortUrl(LongUrl as string) as String
And this routine will create a new record in a database and store the long URL in it, and then simply return the database record number (maybe as a base-64 or other method to keep the character count low if you plan on storing 10k+ Urls)
So for example, when you first call the routine with
http://myurl.de?file=8787fshifncinfdvh.PDF as the long url, the routine will return a "1' because that was the first record to be created in the database. So the short URL would then be
www.myurl.de/1
And when that url is later presented to your website, your "DecodeShortURL" routine it will simply lookup to see what the full url is in the database record #1 and redirect to it.
This is obviously a very simple example - and will easily allow any user to simply substitute the number 1 with a different number to gain access to whatever full url is in that record number. So if security is an issue, then you will need to add a little encryption to the generated short URL to prevent "browsing" by rejecting invalid shortcodes.