you can try this to convert your string. It will be converted to Base64and then hex so that you can put the URL.
var inputString = "xxxxx";
var code = Convert.ToBase64String((new ASCIIEncoding()).GetBytes(inputString)).ToCharArray().Select(x => String.Format("{0:X}", (int)x)).Aggregate(new StringBuilder(), (x, y) => x.Append(y)).ToString();
and this to return a string, from hexadecimal to Base64and from Base64to the original string
var back = (new ASCIIEncoding()).GetString(Convert.FromBase64String(Enumerable.Range(0, code.Length / 2).Select(i => code.Substring(i * 2, 2)).Select(x => (char)Convert.ToInt32(x, 16)).Aggregate(new StringBuilder(), (x, y) => x.Append(y)).ToString()));
source
share