decode-encode
decode-encode
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
namespace Tool_HamSter
{
// Token: 0x02000002 RID: 2
public static class EncodeDecode
{
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
public static string Encode(string text)
{
text = text.Trim();
List<char> chars = new List<char>();
string text2 = "";
for (int i = 0; i < text.Length; i++)
{
chars.Add(text[i]);
}
for (int j = 0; j < chars.Count; j++)
{
chars[j] =
char.Parse(EncodeDecode.EncodeCharcter(char.ToString(chars[j])));
}
for (int k = 0; k < chars.Count / 2; k++)
{
bool flag = chars.Count % 2 != 0 && k == chars.Count / 2;
if (flag)
{
break;
}
int sum = (int)(chars[k] + chars[chars.Count - k - 1]);
bool flag2 = sum % 2 == 0;
if (flag2)
{
bool flag3 = chars[k] > chars[chars.Count - k - 1];
if (flag3)
{
text2 += ":";
text2 += ((int)(chars[k] - chars[chars.Count -
k - 1])).ToString();
}
bool flag4 = chars[k] == chars[chars.Count - k - 1];
if (flag4)
{
text2 += ":0";
}
bool flag5 = chars[k] < chars[chars.Count - k - 1];
if (flag5)
{
text2 += ":-";
text2 += ((int)(chars[chars.Count - k - 1] -
chars[k])).ToString();
}
chars[k] = (char)(sum / 2);
chars[chars.Count - k - 1] = (char)(sum / 2);
}
}
text = "";
for (int l = 0; l < chars.Count; l++)
{
text += chars[l].ToString();
}
text = text + " " + text2;
text = EncodeDecode.Encrypt(text, "hst");
return text;
}