mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
Rename canonical_hash to `hash
This commit is contained in:
@@ -45,7 +45,7 @@ mod tests {
|
||||
|
||||
use std::{fs::File, io::prelude::*, path::PathBuf};
|
||||
|
||||
use super::{hashing::canonical_hash, *};
|
||||
use super::{hashing::hash, *};
|
||||
|
||||
#[test]
|
||||
fn test_shuffling() {
|
||||
@@ -70,7 +70,7 @@ mod tests {
|
||||
let seed_bytes = test_case["seed"].as_str().unwrap().as_bytes();
|
||||
|
||||
let seed = if seed_bytes.len() > 0 {
|
||||
canonical_hash(seed_bytes)
|
||||
hash(seed_bytes)
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::hashing::canonical_hash;
|
||||
use super::hashing::hash;
|
||||
|
||||
const SEED_SIZE_BYTES: usize = 32;
|
||||
const RAND_BYTES: usize = 3; // 24 / 8
|
||||
@@ -16,7 +16,7 @@ impl ShuffleRng {
|
||||
/// Create a new instance given some "seed" bytes.
|
||||
pub fn new(initial_seed: &[u8]) -> Self {
|
||||
Self {
|
||||
seed: canonical_hash(initial_seed),
|
||||
seed: hash(initial_seed),
|
||||
idx: 0,
|
||||
rand_max: RAND_MAX,
|
||||
}
|
||||
@@ -24,7 +24,7 @@ impl ShuffleRng {
|
||||
|
||||
/// "Regenerates" the seed by hashing it.
|
||||
fn rehash_seed(&mut self) {
|
||||
self.seed = canonical_hash(&self.seed);
|
||||
self.seed = hash(&self.seed);
|
||||
self.idx = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user