Files
vxunderground-VX-API/VX-API/HashStringUnknownGenericHash1.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

41 lines
692 B
C++

#include "Win32Helper.h"
INT HashStringUnknownGenericHash1A(_In_ PCHAR String)
{
PCHAR Pointer;
INT Generic;
INT Hash = 0;
for (Pointer = String; *Pointer != '\0'; Pointer++)
{
Hash = (Hash << 4) + (INT)(*Pointer);
Generic = Hash & 0xF0000000L;
if (Generic != 0)
Hash = Hash ^ (Generic >> 24);
Hash = Hash & ~Generic;
}
return Hash;
}
INT HashStringUnknownGenericHash1W(_In_ PWCHAR String)
{
PWCHAR Pointer;
INT Generic;
INT Hash = 0;
for (Pointer = String; *Pointer != '\0'; Pointer++)
{
Hash = (Hash << 4) + (INT)(*Pointer);
Generic = Hash & 0xF0000000L;
if (Generic != 0)
Hash = Hash ^ (Generic >> 24);
Hash = Hash & ~Generic;
}
return Hash;
}