mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-24 03:26:30 +00:00
Support old CPUs
This commit is contained in:
+1
-1
@@ -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"
|
||||
|
||||
+4
-5
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user