Skip to main content

next

Function next 

Source
pub fn next() -> u64
Available on crate feature rand only.
Expand description

生成下一个 64 位随机数(热路径)。

快路径为 mix64 搅拌计数器,每 1024 次调用或首次调用时用 seed 重播种。 线程安全,可在 no_std 下使用。

§Feature Requirement

需要启用 "rand" 特性。

§Examples

use lib_unknown::rand::next;

let a = next();
let b = next();
assert_ne!(a, b);