Returns a string hash for the given string. The string is normalized before hashing.
The hash is supposed to be case-insensitive of the input string: this works for ASCII and (Reforged) some small subset of Unicode (Latin Supplement, Cyrillic...). Also the backslash is the same as forward slash:
\. A probable explanation for this is the usage of file paths, since the game runs on Windows and Mac OS/OSX. StringHash is also used for variable lookup: string name -> integer index.
StringHash("\\") == StringHash("/")
StringHash("AB") == StringHash("ab")
Breaking: The hashing of multi-byte characters (Unicode) was changed in v1.30.0/1.31.1. It's unknown if hashes of these characters are different in old versions between Windows/Mac OS or depends on OS-default character page settings (non-Unicode programs on Windows).
- This function is pure. For the same values passed to it, it will always return the same value.
- return type
- Source code
native StringHash takes string s returns integer