This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| function_requests [2019/07/06 14:21] – created monsterovich | function_requests [2019/07/07 15:45] (current) – monsterovich | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Requesting functions ====== | ====== Requesting functions ====== | ||
| - | These function | + | These functions |
| 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; | ||
| } | } | ||