Sorceress

Untitled

Oct 9th, 2017
221
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int elfHash(int x) {
  2.  
  3. int h = 0;
  4. for(int i = 0; i < 32; ++i) {
  5. if(x % 2)
  6. h = h * 33 + 1511;
  7. else
  8. h = h * 31 + 1699;
  9.  
  10. x /= 2;
  11. }
  12.  
  13. return h;
  14.  
  15. }
RAW Paste Data