Advertisement
EddyKrieger

nechapu.cs

Mar 21st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 KB | None | 0 0
  1. internal static uint h(string s)
  2.     {
  3.         if (string.IsNullOrEmpty(s))
  4.             return 123;
  5.         int sind = 0;
  6.         int num = 0x15051505;
  7.         int num2 = num;
  8.         for (int i = s.Length; i > 0; i -= 4)
  9.         {
  10.             if (sind + 1 < s.Length) num = (((num << 5) + num) + (num >> 0x1b)) ^ ((int)s[sind] | (int)s[sind + 1] << 16);//(numPtr[0]);
  11.             else
  12.             {
  13.                 if (sind < s.Length) num = (((num << 5) + num) + (num >> 0x1b)) ^ ((int)s[sind]);//(numPtr[0]);
  14.                 else num = (((num << 5) + num) + (num >> 0x1b)) ^ (0);
  15.             }
  16.   if (i <= 2) break;
  17.  
  18.             sind += 2;
  19.             if (sind + 1 < s.Length) {num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ ((int)s[sind] | (int)s[sind + 1] << 16);}
  20.             else
  21.             {
  22.                 if (sind < s.Length) { num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ ((int)s[sind]);}
  23.                 else { num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ (0);}
  24.             }
  25.             sind += 2;
  26.         }
  27.         return (uint)(num + (num2 * 0x5d588b65));
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement