| 42 | } |
| 43 | |
| 44 | DWORD Hash(const char *s, int type) |
| 45 | { |
| 46 | char ch; |
| 47 | DWORD seed1, seed2; |
| 48 | |
| 49 | seed1 = 0x7FED7FED; |
| 50 | seed2 = 0xEEEEEEEE; |
| 51 | while (s != NULL && *s) { |
| 52 | ch = *s++; |
| 53 | ch = toupper(ch); |
| 54 | seed1 = hashtable[(type << 8) + ch] ^ (seed1 + seed2); |
| 55 | seed2 += ch + seed1 + (seed2 << 5) + 3; |
| 56 | } |
| 57 | return seed1; |
| 58 | } |
| 59 | |
| 60 | void InitHash() |
| 61 | { |
no outgoing calls
no test coverage detected