internal string HashUrlEncode(string decoded, bool upperCase)
{
StringBuilder ret = new StringBuilder();
RandomStringGenerator stringGen = new RandomStringGenerator();
try
{
for (int i = 0; i < decoded.Length; i = i + 2)
{
char tempChar;
// the only case in which something should not be escaped, is when it is alphanum,
// or it's in marks
// in all other cases, encode it.
tempChar = (char)Convert.ToUInt16(decoded.Substring(i, 2), 16);
ret.Append(tempChar);
}
}
catch (Exception ex)
{
AddLogLine(ex.ToString());
}
return stringGen.Generate(ret.ToString(), upperCase);
}