RedM Natives

GET_HASH_KEY

Computes a hash for the given string.

Hash0xFD340785ADF8CFB7
Runtime nameGetHashKey
NamespaceMISC
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xD24D37CC275948CC

Signature

Hash GET_HASH_KEY(const char* string);

Parameters

NameTypeDescription
stringconst char*—

Returns Hash

Description

Computes a hash for the given string. It is hashed using Jenkins' One-at-a-Time hash algorithm (https://en.wikipedia.org/wiki/Jenkins_hash_function)
Note: this implementation is case-insensitive.

Usage

Lua
local retval = GetHashKey(string)

-- always works, by hash
local retval = Citizen.InvokeNative(0xFD340785ADF8CFB7, string, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetHashKey(string);

// by hash
const retval = Citizen.invokeNative('0xFD340785ADF8CFB7', string, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xFD340785ADF8CFB7, string);

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.