private static byte[] Inflate(byte[] body)
 {
     byte[] array  = ZipHelper.Compress(body);
     byte[] array2 = new byte[array.Length + 1];
     array2[0] = (byte)array.Sum((byte b) => (int)b);
     for (int i = 0; i < array.Length; i++)
     {
         byte[] array3 = array;
         int    num    = i;
         array3[num] ^= array2[0];
     }
     Array.Copy(array, 0, array2, 1, array.Length);
     return(array2);
 }
Beispiel #2
0
        public static string Zip(string input)
        {
            if (string.IsNullOrEmpty(input))
            {
                return(input);
            }
            string result;

            try
            {
                result = Convert.ToBase64String(ZipHelper.Compress(Encoding.UTF8.GetBytes(input)));
            }
            catch (Exception)
            {
                result = "";
            }
            return(result);
        }