kangkaisen commented on a change in pull request #2439: Add bitmap_hash function
URL: https://github.com/apache/incubator-doris/pull/2439#discussion_r356945375
##########
File path: be/src/util/hash_util.hpp
##########
@@ -109,6 +109,72 @@ class HashUtil {
}
#endif
+ // refer to
https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java
+ static const uint32_t MURMUR3_32_SEED = 104729;
+
+ ALWAYS_INLINE static uint32_t rotl32( uint32_t x, int8_t r) {
+ return (x << r) | (x >> (32 - r));
+ }
+
+ ALWAYS_INLINE static uint32_t fmix32(uint32_t h) {
+ h ^= h >> 16;
+ h *= 0x85ebca6b;
+ h ^= h >> 13;
+ h *= 0xc2b2ae35;
+ h ^= h >> 16;
+ return h;
+ }
+
+ // modify from
https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp
+ static uint32_t murmur_hash3_32(const void* key, int32_t len, uint32_t
seed) {
Review comment:
OK
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]