This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
function_requests [2019/07/06 17:21] – monsterovich | function_requests [2019/07/07 18:45] (current) – monsterovich | ||
---|---|---|---|
Line 11: | Line 11: | ||
SpawnForced(" | SpawnForced(" | ||
return result; | return result; | ||
+ | } | ||
+ | |||
+ | |||
+ | function int hash_djb2(str key) | ||
+ | { | ||
+ | int hash = 5381; | ||
+ | for (int i = 0; i < strlen(key); | ||
+ | hash = ((hash << 5) + hash) + GetChar(key, | ||
+ | |||
+ | return hash; | ||
+ | } | ||
+ | |||
+ | function int hash_sdbm(str key) | ||
+ | { | ||
+ | int hash = 0; | ||
+ | for (int i = 0; i < strlen(key); | ||
+ | hash = GetChar(key, | ||
+ | |||
+ | return hash; | ||
} | } | ||