beachboy <st******@hellokitty.com> wrote:
I want to rewrite the url bcoz my unique id (GUID) is too long and google
will stop to search such long long url
Anyone did it previously???
If you rewrite the URL, surely you'll lose the uniqueness unless you're
very careful.
One alternative would be to make your app use shorter URLs by encoding
the GUID in a different way. You can cut down the space taken by using
Base64 encoding, and knocking off the trailing "==" (which you can put
back yourself very easily). You'd end up going down from 36 characters
to 22, assuming you're using Guid.ToString() (effectively).
Call Convert.ToBase64String (guid.ToByteArray()) and then trim the last
two characters. On the reverse side, add the "==" back on the end, call
Convert.FromBase64String, and then call new Guid (bytes).
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too