Expand description
Helper functions for implementing RngCore functions.
For cross-platform reproducibility, these functions all use Little Endian:
least-significant part first. For example, next_u64_via_u32 takes u32
values x, y, then outputs (y << 32) | x. To implement next_u32
from next_u64 in little-endian order, one should use next_u64() as u32.
Byte-swapping (like the std to_le functions) is only needed to convert
to/from byte sequences, and since its purpose is reproducibility,
non-reproducible sources (e.g. OsRng) need not bother with it.
Functionsยง
- fill_
bytes_ via_ next - Implement
fill_bytesvianext_u64andnext_u32, little-endian order. - fill_
via_ u32_ chunks Deprecated - Implement
fill_bytesby reading chunks from the output buffer of a block based RNG. - fill_
via_ u64_ chunks Deprecated - Implement
fill_bytesby reading chunks from the output buffer of a block based RNG. - next_
u32_ via_ fill - Implement
next_u32viafill_bytes, little-endian order. - next_
u64_ via_ fill - Implement
next_u64viafill_bytes, little-endian order. - next_
u64_ via_ u32 - Implement
next_u64vianext_u32, little-endian order.