Current code is:
public static int hashCode(byte[] value) {
int h = 0;
byte[] var2 = value;
int var3 = value.length;
for(int var4 = 0; var4 < var3; ++var4) {
byte v = var2[var4];
h = 31 * h + (v & 255);
}
return h;
}
Possible code is:
public static int hashCode(byte[] value) {
int h = 0;
int var2 = value.length;
for(int var3 = 0; var3 < var2; ++var3) {
byte v = value[var3];
h = 31 * h + (v & 255);
}
return h;
}
In java.lang package, there is a utility class called StringLatin1. This class has hashCode method which will be called from String class's hashCode method, if current string value is latin.
PS: I use Java 11.
Whatever current code you have posted is not the real code; it's the decompiled code which may vary from decompiler to decompiler and therefore you can not rely on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With