Skip to content

Commit e918527

Browse files
Claudenwgarydgregory
authored andcommitted
Added javadoc messages concerning hash64 seed and sign extension. (#34)
1 parent 95bc7e1 commit e918527

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/main/java/org/apache/commons/codec/digest/MurmurHash3.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ public static int hash32x86(final byte[] data, final int offset, final int lengt
428428
* {@linkplain #hash128x64(byte[])} with the same byte data from the {@code long}.
429429
* This method will be removed in a future release.</p>
430430
*
431+
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
432+
* this result as the default seed is positive.<p>
433+
*
431434
* <p>This is a helper method that will produce the same result as:</p>
432435
*
433436
* <pre>
@@ -471,6 +474,9 @@ public static long hash64(final long data) {
471474
* {@linkplain #hash128x64(byte[])} with the same byte data from the {@code int}.
472475
* This method will be removed in a future release.</p>
473476
*
477+
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
478+
* this result as the default seed is positive.<p>
479+
*
474480
* <p>This is a helper method that will produce the same result as:</p>
475481
*
476482
* <pre>
@@ -512,6 +518,9 @@ public static long hash64(final int data) {
512518
* {@linkplain #hash128x64(byte[])} with the same byte data from the {@code short}.
513519
* This method will be removed in a future release.</p>
514520
*
521+
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
522+
* this result as the default seed is positive.<p>
523+
*
515524
* <p>This is a helper method that will produce the same result as:</p>
516525
*
517526
* <pre>
@@ -555,6 +564,9 @@ public static long hash64(final short data) {
555564
* {@linkplain #hash128x64(byte[])} with the same byte data.
556565
* This method will be removed in a future release.</p>
557566
*
567+
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
568+
* this result as the default seed is positive.<p>
569+
*
558570
* <p>This is a helper method that will produce the same result as:</p>
559571
*
560572
* <pre>
@@ -584,6 +596,9 @@ public static long hash64(final byte[] data) {
584596
* {@linkplain #hash128x64(byte[])} with the same byte data.
585597
* This method will be removed in a future release.</p>
586598
*
599+
* <p>Note: The sign extension bug in {@link #hash64(byte[], int, int, int)} does not effect
600+
* this result as the default seed is positive.<p>
601+
*
587602
* <p>This is a helper method that will produce the same result as:</p>
588603
*
589604
* <pre>
@@ -612,6 +627,9 @@ public static long hash64(final byte[] data, final int offset, final int length)
612627
* <p>This is a Murmur3-like 64-bit variant.
613628
* This method will be removed in a future release.</p>
614629
*
630+
* <p>This implementation contains a sign-extension bug in the seed initialization.
631+
* This manifests if the seed is negative.<p>
632+
*
615633
* <p>This algorithm processes 8 bytes chunks of data in a manner similar to the 16 byte chunks
616634
* of data processed in the MurmurHash3 {@code MurmurHash3_x64_128} method. However the hash
617635
* is not mixed with a hash chunk from the next 8 bytes of data. The method will not return

0 commit comments

Comments
 (0)