crates/nailkov/src/distribution.rs
crates/nailkov/src/distribution.rs
This file has not been changed.
crates/nailkov/src/lib.rs
crates/nailkov/src/lib.rs
This file has not been changed.
+2
-2
crates/nailkov/src/token.rs
+2
-2
crates/nailkov/src/token.rs
···
48
48
#[inline]
49
49
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
50
50
// Use only with an IdentityHasher so that you don't rehash the hash
51
-
self.double_hash().hash(state);
51
+
self.mix_hashes().hash(state);
52
52
}
53
53
}
54
54
···
62
62
/// Method from [fastbloom](https://github.com/tomtomwombat/fastbloom/blob/main/src/hasher.rs#L190),
63
63
/// which was in turn adapted from <https://www.eecs.harvard.edu/~michaelm/postscripts/rsa2008.pdf>.
64
64
#[inline(always)]
65
-
fn double_hash(&self) -> u64 {
65
+
fn mix_hashes(&self) -> u64 {
66
66
self.left
67
67
.0
68
68
.digest()
History
3 rounds
0 comments
expand 0 comments
pull request successfully merged
1 commit
expand
collapse
perf: Improve TokenPair hashing for faster generation
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
perf: Improve TokenPair hashing for faster generation