BF2Statistics.Gamespy.CDKeyServer.Xor C# (CSharp) Method

Xor() private static method

Encrypts / Descrypts the CDKey Query String
private static Xor ( string s ) : string
s string
return string
        private static string Xor(string s)
        {
            const string gamespy = "gamespy";
            int length = s.Length;
            char[] data = s.ToCharArray();
            int index = 0;

            for (int i = 0; length > 0; length--)
            {
                if (i >= gamespy.Length)
                    i = 0;

                data[index++] ^= gamespy[i++];
            }

            return new String(data);
        }