Lua support for compile-time Jenkins hashes

Originally published at: https://cookbook.fivem.net/2019/06/23/lua-support-for-compile-time-jenkins-hashes/

In GTA/RAGE games, you’ll often encounter native functions either taking or returning a Jenkins one-at-a-time hash, like the ones returned by GET_HASH_KEY. Traditionally, code would have had to either hardcode hashes (like -1044093321), or use GET_HASH_KEY directly (like GetHashKey(“a_m_y_skater_01”)). This would have lead to either less readability and maintainability, or having to wait for a…

6 Likes