MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / MPQHash

Function MPQHash

LuaSTGPlus/Dictionary.hpp:45–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 /// @brief MPQ Hash�㷨
44 template <uint32_t dwHashType>
45 uint32_t MPQHash(const char* key)
46 {
47 uint32_t seed1 = 0x7FED7FED, seed2 = 0xEEEEEEEE;
48 uint32_t ch;
49 while (*key != 0)
50 {
51 ch = static_cast<unsigned char>(*key++);
52 seed1 = MPQHashCryptTable::GetInstance()[(dwHashType << 8) + ch] ^ (seed1 + seed2);
53 seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
54 }
55 return seed1;
56 }
57
58 /// @brief �ֵ��
59 struct DictionaryKey

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected