I’ve been getting into mapping a lot lately and as a result have been exploring the “Jenkins One-At-A-Time” one-way hashing algorithm. It’s pretty nifty stuff!
Context (for those that are unaware):
The joaat function is used in many aspects of the game and allows any possible string to be translated into an address with 8-hex characters within them. Here’s an example: 0x12345678
More info here:
HOWEVER, I’ve discovered a bug. Check this out:
Example
So when we run the following line of code:
print(joaat("i_love_Capitals"))
We SHOULD get back the following hex address:
0x15608B05
However, if you were to TEST this in game, natively, you’d see that you get back the following result instead:
0x25A60D63
Which is a result of the following code instead:
print(joaat("i_love_capitals"))
Not sure where this is coming from (fiveM or the Game itself), nor where to report it, but this caused a few tripups while making some thing for mapping
For the record, a site like this one will show you the correct interpretation for both instances of the string!
for everyone else
If you’re getting into mapping or mapping and using GTAV’s joaat() function, DON’T use this with capital letters - you will get the wrong result!
uhh lammmmee! Okay, well at least I know. A lot of map modders use uppercase filenames and uppercase naming for things (for whatever reason). Im sure people somewhere are suffering unknowingly because of this, but now it’s written down somewhere
Last question - Is the joaat() function a fiveM thing or a GTA V native thing?
-- joaat(input [, ignore_casing]): Compute the Jenkins hash of the input string.
-- If 'ignore_casing' is true, the byte data is hashed as is. Otherwise, each
-- ASCII character is tolower'd prior to hashing.
> joaat("Hello, World!")
1395890823