Files
vxunderground-VX-API/VX-API/HashStringDjb2.cpp
T
vxunderground f0b5d2bd5d Function renames, code base refactor
Some function names renamed to avoid confusion, some function annotations added.
2022-09-13 06:16:55 -05:00

23 lines
321 B
C++

#include "Win32Helper.h"
DWORD HashStringDjb2A(_In_ PCHAR String)
{
ULONG Hash = 5381;
INT c;
while (c = *String++)
Hash = ((Hash << 5) + Hash) + c;
return Hash;
}
DWORD HashStringDjb2W(_In_ PWCHAR String)
{
ULONG Hash = 5381;
INT c;
while (c = *String++)
Hash = ((Hash << 5) + Hash) + c;
return Hash;
}