Advertisement
Sorceress

Untitled

Oct 9th, 2017
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement