Remove unused StringUtils.hashString and FastMath.hash
Neither matches the client string hash; Hasher.SBStringHash does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ac5a248db
commit
99a4a6741a
2 files changed
-87
No files matched your search
@@ -57,63 +57,6 @@ public class StringUtils {
|
||||
return Long.toHexString(l).toUpperCase();
|
||||
}
|
||||
|
||||
// Well done IDA Pro.
|
||||
|
||||
public static int hashString(String toHash) {
|
||||
byte[] hashArray = toHash.getBytes();
|
||||
int hash = 0;
|
||||
int shift = 0;
|
||||
if (hashArray.length == 8 || hashArray.length == 7) {
|
||||
int ecx = 0;
|
||||
if (hashArray.length == 8) {
|
||||
ecx = hashArray[7];
|
||||
}
|
||||
int eax = hashArray[4];
|
||||
int esi = ecx * 0x8;
|
||||
eax ^= esi;
|
||||
ecx ^= 0x5A0;
|
||||
esi = hashArray[5];
|
||||
eax <<= 4;
|
||||
eax ^= esi;
|
||||
esi = hashArray[6];
|
||||
eax <<= 4;
|
||||
eax ^= esi;
|
||||
esi = hashArray[2];
|
||||
eax <<= 5;
|
||||
eax ^= esi;
|
||||
esi = hashArray[1];
|
||||
int edx = hashArray[0];
|
||||
eax <<= 5;
|
||||
eax ^= esi;
|
||||
ecx /= 2;
|
||||
ecx /= 2;
|
||||
eax <<= 5;
|
||||
ecx ^= edx;
|
||||
eax ^= ecx;
|
||||
return eax;
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < hashArray.length; i++) {
|
||||
if (i == 0)
|
||||
shift = 0;
|
||||
else
|
||||
shift += 5;
|
||||
int toShift = hashArray[i] - 0x20;
|
||||
int shifted = (toShift << shift);
|
||||
hash ^= shifted;
|
||||
if (shift > 24) {
|
||||
int newShift = 0x20 - shift;
|
||||
int newShifted = toShift >> newShift;
|
||||
hash ^= newShifted;
|
||||
if (shift > 27) {
|
||||
shift -= 0x20;
|
||||
}
|
||||
}
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
public static String wordWrap(String text, int LineWidth) {
|
||||
StringTokenizer st = new StringTokenizer(text);
|
||||
int SpaceLeft = LineWidth;
|
||||
|
||||
Reference in new issue
Block a user