views:

25

answers:

0

I need to make a url shortener for work, so I'm trying to figure out what is going to be the best schema to provide the largest possible number of links in the smallest possible id string.

I had thought of converting unicode characters to bit values to use as ids for a simple database--is such a thing possible? Is there any particular unicode characters that wouldn't get relayed to the server at all? I can access the raw address string as-is to find out exactly what url was entered, but I need to make sure everything that should be there is there. # is one particular example I am unsure of; it being a client-side functionality (anchors), I don't know if it actually gets to the server.

I don't need any randomness to the generated id, I was thinking of just incrementing from the lowest unicode bit value to the highest, basically getting thousands upon thousands of possibilities per-character.

Any advice, help or code samples are appreciated. :)