MCPcopy Create free account
hub / github.com/diasurgical/devilution / Hash

Function Hash

Source/encrypt.cpp:44–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44DWORD 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
60void InitHash()
61{

Callers 6

WriteBlockTableMethod · 0.85
WriteHashTableMethod · 0.85
FetchHandleFunction · 0.85
mpqapi_add_fileFunction · 0.85
OpenMPQFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected