Skip to content

Commit 532fdf8

Browse files
committed
murmur3
1 parent bff84e9 commit 532fdf8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/randstrobes.cpp

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <bitset>
44
#include <algorithm>
55
#include <cassert>
6+
#include <nmmintrin.h>
67

78
#include "hash.hpp"
89
#include "randstrobes.hpp"
@@ -30,19 +31,30 @@ static unsigned char seq_nt4_table[256] = {
3031
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
3132
};
3233

34+
35+
uint64_t murmur3(uint64_t key) {
36+
key ^= (key >> 33);
37+
key *= 0xff51afd7ed558ccd;
38+
key ^= (key >> 33);
39+
key *= 0xc4ceb9fe1a85ec53;
40+
key ^= (key >> 33);
41+
42+
return key;
43+
}
44+
3345
static inline syncmer_hash_t syncmer_kmer_hash(uint64_t packed) {
3446
// return robin_hash(yk);
3547
// return yk;
3648
// return hash64(yk, mask);
3749
// return sahlin_dna_hash(yk, mask);
38-
return xxh64(packed);
50+
return murmur3(packed);
3951
}
4052

4153
static inline syncmer_hash_t syncmer_smer_hash(uint64_t packed) {
4254
// return ys;
4355
// return robin_hash(ys);
4456
// return hash64(ys, mask);
45-
return xxh64(packed);
57+
return murmur3(packed);
4658
}
4759

4860
/*

0 commit comments

Comments
 (0)