diff --git a/cli/src/main.rs b/cli/src/main.rs index c62900e70779..924ea9d77a3a 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -17,7 +17,7 @@ use memmap2::Mmap; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use once_cell::unsync::OnceCell; use same_file::{is_same_file, Handle}; -use siphasher::sip128::{Hasher128, SipHasher}; +use siphasher::sip128::{Hasher128, SipHasher13}; use termcolor::{ColorChoice, StandardStream, WriteColor}; use typst::diag::{FileError, FileResult, SourceError, StrResult}; use typst::eval::Library; @@ -535,7 +535,7 @@ impl PathHash { fn new(path: &Path) -> FileResult { let f = |e| FileError::from_io(e, path); let handle = Handle::from_path(path).map_err(f)?; - let mut state = SipHasher::new(); + let mut state = SipHasher13::new(); handle.hash(&mut state); Ok(Self(state.finish128().as_u128())) } diff --git a/src/eval/value.rs b/src/eval/value.rs index 3fd9ed422ec2..dffc3d035e1e 100644 --- a/src/eval/value.rs +++ b/src/eval/value.rs @@ -5,7 +5,7 @@ use std::hash::{Hash, Hasher}; use std::sync::Arc; use ecow::eco_format; -use siphasher::sip128::{Hasher128, SipHasher}; +use siphasher::sip128::{Hasher128, SipHasher13}; use super::{ cast_to_value, format_str, ops, Args, Array, Cast, CastInfo, Content, Dict, Func, @@ -313,7 +313,7 @@ where fn hash128(&self) -> u128 { // Also hash the TypeId since values with different types but // equal data should be different. - let mut state = SipHasher::new(); + let mut state = SipHasher13::new(); self.type_id().hash(&mut state); self.hash(&mut state); state.finish128().as_u128() diff --git a/src/util/mod.rs b/src/util/mod.rs index c2b232737233..b8bf90d2b438 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -12,7 +12,7 @@ use std::num::NonZeroUsize; use std::path::{Component, Path, PathBuf}; use std::sync::Arc; -use siphasher::sip128::{Hasher128, SipHasher}; +use siphasher::sip128::{Hasher128, SipHasher13}; /// Turn a closure into a struct implementing [`Debug`]. pub fn debug(f: F) -> impl Debug @@ -35,7 +35,7 @@ where /// Calculate a 128-bit siphash of a value. pub fn hash128(value: &T) -> u128 { - let mut state = SipHasher::new(); + let mut state = SipHasher13::new(); value.hash(&mut state); state.finish128().as_u128() }