From 6e949fa469d5ba33b7de3afcc31e9580b7b3a30b Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Tue, 27 Oct 2020 10:31:29 +0100 Subject: [PATCH] moved to xxh3_rust --- Cargo.toml | 2 +- src/utils.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4f37b41229..45b4ea530a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,5 +7,5 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -xxhrs = { version = "2.0.0", features = [] } #"random_entropy"] } +xxhash-rust = { version = "0.8.0-beta.4", features = ["xxh3"] } thiserror = "1.0" diff --git a/src/utils.rs b/src/utils.rs index 8356dd28b8..6176d86b8e 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use std::debug_assert; -use xxhrs::{XXH3_64}; +use xxhash_rust::xxh3::xxh3_64_with_seed; /// Ways to get random around here pub trait Rand: Debug { @@ -60,7 +60,7 @@ impl Rand for Xoshiro256StarRand { fn set_seed(&mut self, seed: u64) { - self.rand_seed[0] = XXH3_64::hash_with_seed(HASH_CONST, &seed.to_le_bytes()); + self.rand_seed[0] = xxh3_64_with_seed(&HASH_CONST.to_le_bytes(), seed); self.rand_seed[1] = self.rand_seed[0] ^ 0x1234567890abcdef; self.rand_seed[2] = self.rand_seed[0] & 0x0123456789abcdef; self.rand_seed[3] = self.rand_seed[0] | 0x01abcde43f567908;