Skip to content

Commit b75fad1

Browse files
authored
Change SipHash2-4 -> SipHash1-3 (#1)
1 parent 73eeffb commit b75fad1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/cache.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::any::{Any, TypeId};
22
use std::cell::RefCell;
33
use std::collections::HashMap;
44

5-
use siphasher::sip128::{Hasher128, SipHasher};
5+
use siphasher::sip128::{Hasher128, SipHasher13};
66

77
use crate::constraint::Join;
88
use crate::input::Input;
@@ -23,7 +23,7 @@ where
2323
CACHE.with(|cache| {
2424
// Compute the hash of the input's key part.
2525
let key = {
26-
let mut state = SipHasher::new();
26+
let mut state = SipHasher13::new();
2727
input.key(&mut state);
2828
let hash = state.finish128().as_u128();
2929
(id, hash)

src/constraint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::cell::RefCell;
22
use std::hash::Hash;
33

4-
use siphasher::sip128::{Hasher128, SipHasher};
4+
use siphasher::sip128::{Hasher128, SipHasher13};
55

66
use crate::track::Trackable;
77

@@ -121,7 +121,7 @@ where
121121
/// Produce a 128-bit hash of a value.
122122
#[inline]
123123
pub fn hash<T: Hash>(value: &T) -> u128 {
124-
let mut state = SipHasher::new();
124+
let mut state = SipHasher13::new();
125125
value.hash(&mut state);
126126
state.finish128().as_u128()
127127
}

src/prehashed.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::fmt::{self, Debug, Formatter};
44
use std::hash::{Hash, Hasher};
55
use std::ops::Deref;
66

7-
use siphasher::sip128::{Hasher128, SipHasher};
7+
use siphasher::sip128::{Hasher128, SipHasher13};
88

99
/// A wrapper type with precomputed hash.
1010
///
@@ -62,7 +62,7 @@ impl<T: Hash + 'static> Prehashed<T> {
6262
fn hash<T: Hash + 'static>(item: &T) -> u128 {
6363
// Also hash the TypeId because the type might be converted
6464
// through an unsized coercion.
65-
let mut state = SipHasher::new();
65+
let mut state = SipHasher13::new();
6666
item.type_id().hash(&mut state);
6767
item.hash(&mut state);
6868
state.finish128().as_u128()

0 commit comments

Comments
 (0)