• Pure

    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: / and \. 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")

    Parameters

    • s: string

    Returns number

    Note

    Code for the algorithm "SStrHash2" via "1997 Dr Dobbs article".

    Note

    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).

    Patch

    1.24a

Generated using TypeDoc