Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. int hashingMagic(const char *desc) {
  2. size_t keyLen = strlen(desc);
  3. char ch = *desc;
  4. char ch2, ch3;
  5.  
  6. if (*desc) {
  7. ch2 = *(char *)(desc + 1);
  8. uint64_t hashed = 0x1505;
  9.  
  10. do {
  11. hashed = 33 * hashed + ch;
  12. ch3 = *ch2++;
  13. ch = ch3;
  14. }
  15. while (ch3);
  16. }
  17. else hashed = 0x1505;
  18.  
  19. return (int)hashed;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement