Skip to content

Commit

Permalink
Asymmetric randstrobe hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Feb 28, 2024
1 parent d420610 commit 7ca428d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/randstrobes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ static inline syncmer_hash_t syncmer_smer_hash(uint64_t packed) {
return xxh64(packed);
}

static inline randstrobe_hash_t randstrobe_hash(syncmer_hash_t hash1, syncmer_hash_t hash2) {
return hash1 + hash2;
static inline randstrobe_hash_t randstrobe_hash(syncmer_hash_t syncmer1_hash, syncmer_hash_t syncmer2_hash) {
// alternative:
// (syncmer1_hash << 1) ^ syncmer2_hash
return 2 * syncmer1_hash - syncmer2_hash;
}

std::ostream& operator<<(std::ostream& os, const Syncmer& syncmer) {
Expand Down

0 comments on commit 7ca428d

Please sign in to comment.