rishabhdaim commented on code in PR #2461: URL: https://github.com/apache/jackrabbit-oak/pull/2461#discussion_r2290659546
########## oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/codec/ChunkedBlobStream.java: ########## @@ -143,8 +144,17 @@ private ByteBuf decorateRawBuffer(ByteBufAllocator allocator, ByteBuf buffer) { buffer.release(); byte mask = createMask(data.length); - Hasher hasher = Hashing.murmur3_32().newHasher(); - long hash = hasher.putByte(mask).putLong(length).putBytes(data).hash().padToLong(); + + final ByteBuffer byteBuffer = ByteBuffer.allocate(1 + 8 + data.length) + .order(ByteOrder.LITTLE_ENDIAN) // To align with Guava that uses Little Endianess + .put(mask) + .putLong(length) + .put(data); + byteBuffer.flip(); // Reset position to start to read data from beginning + final byte[] bytes = new byte[byteBuffer.limit()]; + byteBuffer.get(bytes); + + long hash = Integer.toUnsignedLong(MurmurHash3.hash32x86(bytes)); Review Comment: Let me create a common util function to handle this logic. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org