# fill_bytes_via_next in rand_core::impls - Rust
Implement `fill_bytes` via `next_u64` and `next_u32`, little-endian order.
Keywords: rust, rustlang, rust-lang, fill_bytes_via_next

# Function rand_core::impls::fill_bytes_via_next

source · [−]

    pub fn fill_bytes_via_next<R: RngCore + ?Sized>(rng: &mut R, dest: &mut [u8])

Expand description

Implement `fill_bytes` via `next_u64` and `next_u32`, little-endian order.

The fastest way to fill a slice is usually to work as long as possible with integers. That is why this method mostly uses `next_u64`, and only when there are 4 or less bytes remaining at the end of the slice it uses `next_u32` once.