提交 403c52d2 编写于 作者: J Jordi Boggiano 提交者: Corey Richardson

Add weak_rng to get a random algo that puts more emphasis on speed than security

上级 3db9dc1d
......@@ -619,6 +619,16 @@ pub fn rng() -> IsaacRng {
IsaacRng::new()
}
/// Create a weak random number generator with a default algorithm and seed.
///
/// It returns the fatest `Rng` algorithm currently available in Rust without
/// consideration for cryptography or security. If you require a specifically
/// seeded `Rng` for consistency over time you should pick one algorithm and
/// create the `Rng` yourself.
pub fn weak_rng() -> XorShiftRng {
XorShiftRng::new()
}
static RAND_SIZE_LEN: u32 = 8;
static RAND_SIZE: u32 = 1 << RAND_SIZE_LEN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册