Advertisement
OPVL

GTA jenkins function

Apr 17th, 2017
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. //faster than GET_HASH_KEY, external jenkins algorithm
  2. //credz go to gta5-86442 for his tool source find it at https://www.gta5-mods.com/tools/gta-v-native-hash-tool
  3. #include <string>
  4. #include <algorithm>
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. static Hash CreateHash(string Native)
  10. {
  11.     string lowerNative = Native;
  12.     transform(lowerNative.begin(), lowerNative.end(), lowerNative.begin(), ::tolower);
  13.     Hash num = 0;
  14.     const char* bytes = lowerNative.c_str();;
  15.     int length = strlen(bytes);
  16.     for (int i = 0; i < length; i++)
  17.     {
  18.         num += bytes[i];
  19.         num += num << 10;
  20.         num ^= num >> 6;
  21.     }
  22.     num += num << 3;
  23.     num ^= num >> 11;
  24.     return (num + (num << 15));
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement