HashMap: add info to docs about random seed quality
The random functions that HashMap use make no guarantees about the quality of random data so this documents that to the user so that they are aware. This was brought about by the change to the Linux random code to not block until the urandom pool was initialized to avoid users of crates that internally use HashMap being caught unaware and having their application block until the urandom pool is initialized. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
This commit is contained in:
parent
f875daca54
commit
121225f17d
@ -202,8 +202,10 @@ fn test_resize_policy() {
|
|||||||
/// The hashes are all keyed by the thread-local random number generator
|
/// The hashes are all keyed by the thread-local random number generator
|
||||||
/// on creation by default. This means that the ordering of the keys is
|
/// on creation by default. This means that the ordering of the keys is
|
||||||
/// randomized, but makes the tables more resistant to
|
/// randomized, but makes the tables more resistant to
|
||||||
/// denial-of-service attacks (Hash DoS). This behavior can be
|
/// denial-of-service attacks (Hash DoS). No guarantees are made to the
|
||||||
/// overridden with one of the constructors.
|
/// quality of the random data. The implementation uses the best available
|
||||||
|
/// random data from your platform at the time of creation. This behavior
|
||||||
|
/// can be overridden with one of the constructors.
|
||||||
///
|
///
|
||||||
/// It is required that the keys implement the `Eq` and `Hash` traits, although
|
/// It is required that the keys implement the `Eq` and `Hash` traits, although
|
||||||
/// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`.
|
/// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`.
|
||||||
|
Loading…
Reference in New Issue
Block a user