Original Post
🔒 Locked
decent hash function
Advertisement
It's in the C++ TR1, but chances are that your compiler doesn't have the TR1 available yet. See Boost.hash for a TR1-compatible hash primitive.
This is what I use. I can't remember where i got it from, I know I found the link on Google - anyone know where it's from?
u32 EID::Hash(const wchar_t* pData){ const wchar_t* pPtr = pData; u32 nRet = 5381; while(*pPtr) nRet = ((nRet << 5) + nRet) + *pPtr++; return nRet;}Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement