moved to xxh3_rust
This commit is contained in:
parent
7578fbd790
commit
6e949fa469
@ -7,5 +7,5 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
xxhrs = { version = "2.0.0", features = [] } #"random_entropy"] }
|
xxhash-rust = { version = "0.8.0-beta.4", features = ["xxh3"] }
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::debug_assert;
|
use std::debug_assert;
|
||||||
use xxhrs::{XXH3_64};
|
use xxhash_rust::xxh3::xxh3_64_with_seed;
|
||||||
|
|
||||||
/// Ways to get random around here
|
/// Ways to get random around here
|
||||||
pub trait Rand: Debug {
|
pub trait Rand: Debug {
|
||||||
@ -60,7 +60,7 @@ impl Rand for Xoshiro256StarRand {
|
|||||||
|
|
||||||
|
|
||||||
fn set_seed(&mut self, seed: u64) {
|
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[1] = self.rand_seed[0] ^ 0x1234567890abcdef;
|
||||||
self.rand_seed[2] = self.rand_seed[0] & 0x0123456789abcdef;
|
self.rand_seed[2] = self.rand_seed[0] & 0x0123456789abcdef;
|
||||||
self.rand_seed[3] = self.rand_seed[0] | 0x01abcde43f567908;
|
self.rand_seed[3] = self.rand_seed[0] | 0x01abcde43f567908;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user