//! Utilities for hashmap initialization based on random sources.
use core::hash::{BuildHasher, Hasher};
/// Wasmparser's hashing state stored per-map. /// /// This is DoS-resistant when the `std` feature is activated and still somewhat /// resistant when it's not active but not as secure. #[derive(Clone, Debug)] pubstruct RandomState(RandomStateImpl);
// When the `std` feature is active reuse the standard library's implementation // of hash state and hasher. #[cfg(feature = "std")] use std::collections::hash_map::RandomState as RandomStateImpl;
// When the `std` feature is NOT active then rely on `ahash::RandomState`. That // relies on ASLR by default for randomness. #[derive(Clone, Debug)] #[cfg(not(feature = "std"))] struct RandomStateImpl {
state: ahash::RandomState,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.