Skip to content

Commit

Permalink
Added javadoc messages concerning hash64 seed and sign extension. (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudenw authored and garydgregory committed Dec 28, 2019
1 parent 95bc7e1 commit e918527
Showing 1 changed file with 18 additions and 0 deletions.
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

0 comments on commit e918527

Please sign in to comment.