Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal static uint h(string s)
- {
- if (string.IsNullOrEmpty(s))
- return 123;
- int sind = 0;
- int num = 0x15051505;
- int num2 = num;
- for (int i = s.Length; i > 0; i -= 4)
- {
- if (sind + 1 < s.Length) num = (((num << 5) + num) + (num >> 0x1b)) ^ ((int)s[sind] | (int)s[sind + 1] << 16);//(numPtr[0]);
- else
- {
- if (sind < s.Length) num = (((num << 5) + num) + (num >> 0x1b)) ^ ((int)s[sind]);//(numPtr[0]);
- else num = (((num << 5) + num) + (num >> 0x1b)) ^ (0);
- }
- if (i <= 2) break;
- sind += 2;
- if (sind + 1 < s.Length) {num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ ((int)s[sind] | (int)s[sind + 1] << 16);}
- else
- {
- if (sind < s.Length) { num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ ((int)s[sind]);}
- else { num2 = (((num2 << 5) + num2) + (num2 >> 0x1b)) ^ (0);}
- }
- sind += 2;
- }
- return (uint)(num + (num2 * 0x5d588b65));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement