I was browsing torrents at KickAssTorrents.com, when I visit a link it is encoded in the url in a different way;
for example (IMDb link): http://kat.ph/account/confirm/url/aHR0cDovL3d3dy5pbWRiLmNvbS90aXRsZS90dDA0MDE3Mjk=/
Now, when I change a character something changes in the link and I want to know how to do this in C# or jQuery ?!
In C#:
Use
System.Text.UTF8Encoding.UTF8.GetBytes(...)if stringtoEncodecontains characters outside of ASCII. Note that in this case any party that decodes the URL will have to be able to correctly handle these characters.Also look at the case of
=,+and/mentioned by David Hardin to see if any of the problems mentioned apply to you. Or just use David’s answer.jQuery: google ‘jquery base64 encode’ (the site plugins.jquery.com seems to be offline at the moment, so I cannot check it for sure)