Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. public uint GetHashKey(string input)
  2. {
  3.     if (string.IsNullOrWhiteSpace(input))
  4.     {
  5.         return 0u;
  6.     }
  7.     byte[] bytes = Encoding.UTF8.GetBytes(input.ToLower().ToCharArray());
  8.     uint num = 0u;
  9.     int i = 0;
  10.     int num2 = bytes.Length;
  11.     while (i < num2)
  12.     {
  13.         num += (uint)bytes[i];
  14.         num += num << 10;
  15.         num ^= num >> 6;
  16.         i++;
  17.     }
  18.     num += num << 3;
  19.     num ^= num >> 11;
  20.     return num + (num << 15);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement