reflexo_typst2vec/
hash.rs

1pub use reflexo::hash::*;
2
3/// This function maintain hash function corresponding to Typst
4/// Typst changed the hash function from `siphasher::sip128::SipHasher` to
5/// `siphasher::sip128::SipHasher13` since commit <https://github.com/typst/typst/commit/d0afba959d18d1c2c646b99e6ddd864b1a91deb2>
6/// Commit log:
7/// This seems to significantly improves performance. Inspired by
8/// rust-lang/rust#107925
9///
10/// Update: Use Typst's new util function `typst::utils::hash128`
11#[inline]
12pub fn typst_affinite_hash<T: std::hash::Hash>(t: &T) -> u128 {
13    typst::utils::hash128(t)
14}