We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ec9adb2 + 722897b commit fbf9572Copy full SHA for fbf9572
rand_core/src/lib.rs
@@ -299,6 +299,12 @@ pub trait SeedableRng: Sized {
299
/// reference implementation of the PRNG given equivalent seed; if necessary
300
/// another constructor replicating behaviour from a reference
301
/// implementation can be added.
302
+ ///
303
+ /// PRNG implementations should make sure `from_seed` never panics. In the
304
+ /// case that some special values (like an all zero seed) are not viable
305
+ /// seeds it is preferable to map these to alternative constant value(s),
306
+ /// for example `0xBAD5EEDu32` or `0x0DDB1A5E5BAD5EEDu64` ("odd biases? bad
307
+ /// seed"). This is assuming only a small number of values must be rejected.
308
fn from_seed(seed: Self::Seed) -> Self;
309
310
/// Create a new PRNG seeded from another `Rng`.
0 commit comments