Advertisement
Ember

hash

Mar 7th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. UInt ELFHash(String string)
  2. {
  3.     UInt h = 0;
  4.     for(Int i = 0; i < string.length(); ++i)
  5.     {
  6.         h = (h << 4) + string[i];
  7.         UInt g = h & 0xF0000000L;
  8.         if(g) { h ^= g >> 24; }
  9.         h &= ~g;
  10.     }
  11.  
  12.     return h;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement