We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11c6178 commit 0eefffbCopy full SHA for 0eefffb
src/lib.rs
@@ -1002,6 +1002,15 @@ impl<R: SeedableRng> NewRng for R {
1002
}
1003
1004
1005
+/// Trait for RNG's that do not generate random numbers one at a time, but in
1006
+/// blocks. Especially for cryptographic RNG's it is common to generate 16 or
1007
+/// more results at a time.
1008
+pub trait BlockRngCore<T>: Sized {
1009
+ type Results: AsRef<[T]> + Default;
1010
+
1011
+ fn generate(&mut self, results: &mut Self::Results) -> Result<(), Error>;
1012
+}
1013
1014
/// The standard RNG. The PRNG algorithm in `StdRng` is choosen to be efficient
1015
/// on the current platform, to be statistically strong and unpredictable
1016
/// (meaning a cryptographically secure PRNG).
0 commit comments