mirror of
https://github.com/vxunderground/VX-API
synced 2024-06-27 09:18:36 +00:00
Create HashStringUnknownGenericHash1.cpp
This commit is contained in:
parent
449f7a0119
commit
4705e3fa53
@ -0,0 +1,39 @@
|
|||||||
|
INT HashStringUnknownGenericHash1A(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(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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user