Jass documentation Database

JASS Documentation Database REFORGED

Results for the query "StringHash" as a "function"

The search keyword must be a single word (no spaces).

Function StringHash

Line: 2236
Location: common.j
Constant? no
Type: native
Arguments: string s
Returns: integer


Extra spaces may have been removed from the original file to show the function in a comfortable way.
  1. native StringHash takes string s returns integer

Information about StringHash

Information contributed by City17
on February 25, 2022, 04:45:19 PM.
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?
Page loaded in 0.0975 seconds.
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...