From 391d91e3535cdb370d6cc69e04aef506813cc47b Mon Sep 17 00:00:00 2001 From: aherbert Date: Thu, 12 Mar 2020 16:59:40 +0000 Subject: [PATCH] Improved documentation of Murmur3 hash functions. Added references to Commons Codec and SMHasher. --- .../hasher/function/Murmur128x86Cyclic.java | 10 ++++++---- .../hasher/function/Murmur32x86Iterative.java | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java index fbd8cb5cf..d3137d080 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java @@ -21,18 +21,20 @@ import org.apache.commons.collections4.bloomfilter.hasher.HashFunction; /** * An implementation of HashFunction that - * performs Murmur128 hashing using a signed cyclic method. + * uses an underlying Murmur3 128-bit hash with a signed cyclic method. * - *

Requires the optional commons-codec library.

+ *

Requires the optional Apache Commons Codec + * library which contains a Java port of the 128-bit hash function + * {@code MurmurHash3_x64_128} from Austin Applyby's original {@code c++} + * code in SMHasher.

* + * @see SMHasher * @since 4.5 */ public final class Murmur128x86Cyclic implements HashFunction { /** * The name of this hash method. - * - *

TODO: Should this be changed to "Murmur3_128_x64"? */ public static final String NAME = "Murmur3_x64_128"; diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java index 2cad0189f..982ef5c86 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java @@ -21,18 +21,21 @@ import org.apache.commons.collections4.bloomfilter.hasher.HashFunction; /** * An implementation of HashFunction that - * performs Murmur32 hashing using a signed iterative method. + * uses an underlying Murmur3 32-bit hash with a signed iterative method. * - *

Requires the optional commons-codec library.

+ *

Requires the optional Apache Commons Codec + * library which contains a Java port of the 32-bit hash function + * {@code MurmurHash3_x86_32} from Austin Applyby's original {@code c++} + * code in SMHasher.

* + * @see Apache Commons Codec + * @see SMHasher * @since 4.5 */ public final class Murmur32x86Iterative implements HashFunction { /** * The name of this hash function. - * - *

TODO: Should this be changed to "Murmur3_32_x86"? */ public static final String NAME = "Murmur3_x86_32"; @@ -59,6 +62,7 @@ public final class Murmur32x86Iterative implements HashFunction { public String getName() { return NAME; } + @Override public ProcessType getProcessType() { return ProcessType.ITERATIVE;