The search keyword must be a single word (no spaces).
Function StringHash
- Line
- 2245
- Location
- common.j
- Constant?
- no
- Type
- native
- Arguments
- string s
- Returns
- integer
| 2245 | native StringHash takes string s returns integer |
| 2246 | |
| 2247 | native GetLocalizedString takes string source returns string |
| 2248 | native GetLocalizedHotkey takes string source returns integer |
| 2249 | |
| 2250 | //============================================================================
|
Information about StringHash
City17
4 years
returns a string hash for the given string.
The hash is supposed to be case-insensitive of the input string: this works for ASCII and 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.
The underlying algorithm is subject to change between major versions. The Hive: code for the old algorithm "SStrHash2" via "1997 Dr Dobbs article" and a question about the changed algorithm in Reforged. TODO: In what version was it changed?
The hash is supposed to be case-insensitive of the input string: this works for ASCII and 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.
The underlying algorithm is subject to change between major versions. The Hive: code for the old algorithm "SStrHash2" via "1997 Dr Dobbs article" and a question about the changed algorithm in Reforged. TODO: In what version was it changed?
You must be logged in with a standard account to contribute.