Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added javadoc messages concerning hash64 seed and sign extension. #34

Merged
merged 1 commit into from Dec 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
Expand Up @@ -428,6 +428,9 @@ public static int hash32x86(final byte[] data, final int offset, final int lengt
* {@linkplain #hash128x64(byte[])} with the same byte data from the {@code long}.
* This method will be removed in a future release.</p>
*
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
* this result as the default seed is positive.<p>
*
* <p>This is a helper method that will produce the same result as:</p>
*
* <pre>
Expand Down Expand Up @@ -471,6 +474,9 @@ public static long hash64(final long data) {
* {@linkplain #hash128x64(byte[])} with the same byte data from the {@code int}.
* This method will be removed in a future release.</p>
*
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
* this result as the default seed is positive.<p>
*
* <p>This is a helper method that will produce the same result as:</p>
*
* <pre>
Expand Down Expand Up @@ -512,6 +518,9 @@ public static long hash64(final int data) {
* {@linkplain #hash128x64(byte[])} with the same byte data from the {@code short}.
* This method will be removed in a future release.</p>
*
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
* this result as the default seed is positive.<p>
*
* <p>This is a helper method that will produce the same result as:</p>
*
* <pre>
Expand Down Expand Up @@ -555,6 +564,9 @@ public static long hash64(final short data) {
* {@linkplain #hash128x64(byte[])} with the same byte data.
* This method will be removed in a future release.</p>
*
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
* this result as the default seed is positive.<p>
*
* <p>This is a helper method that will produce the same result as:</p>
*
* <pre>
Expand Down Expand Up @@ -584,6 +596,9 @@ public static long hash64(final byte[] data) {
* {@linkplain #hash128x64(byte[])} with the same byte data.
* This method will be removed in a future release.</p>
*
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
* this result as the default seed is positive.<p>
*
* <p>This is a helper method that will produce the same result as:</p>
*
* <pre>
Expand Down Expand Up @@ -612,6 +627,9 @@ public static long hash64(final byte[] data, final int offset, final int length)
* <p>This is a Murmur3-like 64-bit variant.
* This method will be removed in a future release.</p>
*
* <p>This implementation contains a sign-extension bug in the seed initialization.
* This manifests if the seed is negative.<p>
*
* <p>This algorithm processes 8 bytes chunks of data in a manner similar to the 16 byte chunks
* of data processed in the MurmurHash3 {@code MurmurHash3_x64_128} method. However the hash
* is not mixed with a hash chunk from the next 8 bytes of data. The method will not return
Expand Down