From fd8f4caa8133d509610b13ee99ac60d1adadaca3 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 19 Mar 2021 12:19:40 +0100 Subject: Support old CPUs --- src/util/Cargo.toml | 2 +- src/util/data.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/util') diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml index 3c2971de..a83c876b 100644 --- a/src/util/Cargo.toml +++ b/src/util/Cargo.toml @@ -15,7 +15,7 @@ path = "lib.rs" [dependencies] blake2 = "0.9" err-derive = "0.3" -fasthash = "0.4" +xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] } hex = "0.4" log = "0.4" rand = "0.8" diff --git a/src/util/data.rs b/src/util/data.rs index cb784730..8cd6dd96 100644 --- a/src/util/data.rs +++ b/src/util/data.rs @@ -106,12 +106,11 @@ pub fn blake2sum(data: &[u8]) -> Hash { pub type FastHash = u64; pub fn fasthash(data: &[u8]) -> FastHash { - use fasthash::{xx::Hasher64, FastHasher}; - use std::hash::Hasher; + use xxhash_rust::xxh3::Xxh3; - let mut h = Hasher64::new(); - h.write(data); - h.finish() + let mut h = Xxh3::new(); + h.update(data); + h.digest() } pub fn gen_uuid() -> UUID { -- cgit v1.2.3