vxug-VXAPI/Cryptography Related/String Hashing/HashStringSdbm.cpp

22 lines
306 B
C++
Raw Normal View History

2022-07-15 03:30:55 +00:00
DWORD HashStringSdbmA(PCHAR String)
{
ULONG Hash = 0;
INT c;
while (c = *String++)
Hash = c + (Hash << 6) + (Hash << 16) - Hash;
return Hash;
}
DWORD HashStringSdbmW(PWCHAR String)
{
ULONG Hash = 0;
INT c;
while (c = *String++)
Hash = c + (Hash << 6) + (Hash << 16) - Hash;
return Hash;
}