Function malachite_base::chars::random::random_chars
source · [−]pub fn random_chars(seed: Seed) -> RandomCharRangeⓘNotable traits for RandomCharRangeimpl Iterator for RandomCharRange type Item = char;
Expand description
Uniformly generates random char
s.
$P(c) = \frac{1}{2^{20}+2^{16}-2^{11}}$.
The output length is infinite.
Worst-case complexity per iteration
Constant time and additional memory.
Examples
use malachite_base::chars::random::random_chars;
use malachite_base::random::EXAMPLE_SEED;
assert_eq!(
random_chars(EXAMPLE_SEED)
.take(10)
.collect::<String>()
.as_str(),
"\u{5f771}\u{87234}\u{bcd36}\u{9e195}\u{5da07}\u{36553}\u{45028}\u{1cdfd}\u{d8530}\u{c7f2e}"
)