diff --git a/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java b/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java index 45c8b619cf..c585d39918 100644 --- a/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java +++ b/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java @@ -166,7 +166,7 @@ public static long hash64(final byte[] data, final int length, final int seed) { case 2: h ^= (long) (data[(length & ~7) + 1] & 0xff) << 8; case 1: - h ^= (long) (data[length & ~7] & 0xff); + h ^= data[length & ~7] & 0xff; h *= m; } diff --git a/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java b/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java index 7c543adcd0..df46433d09 100644 --- a/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java +++ b/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java @@ -461,7 +461,7 @@ public static long[] hash128(final byte[] data, final int offset, final int leng case 10: k2 ^= (long) (data[offset + tailStart + 9] & 0xff) << 8; case 9: - k2 ^= (long) (data[offset + tailStart + 8] & 0xff); + k2 ^= data[offset + tailStart + 8] & 0xff; k2 *= C2; k2 = Long.rotateLeft(k2, R3); k2 *= C1; @@ -482,7 +482,7 @@ public static long[] hash128(final byte[] data, final int offset, final int leng case 2: k1 ^= (long) (data[offset + tailStart + 1] & 0xff) << 8; case 1: - k1 ^= (long) (data[offset + tailStart] & 0xff); + k1 ^= data[offset + tailStart] & 0xff; k1 *= C1; k1 = Long.rotateLeft(k1, R1); k1 *= C2;