pub fn try_fill_u8(&mut self, dest: &mut [u8]) -> Result<(), Error> {
        for chunk in dest.chunks_mut(4) {
            let mut entropy: [u32; 1] = [0];
            self.try_fill_u32(&mut entropy)?;

            chunk
                .iter_mut()
                .enumerate()
                .for_each(|(idx, byte)| *byte = entropy[0].to_be_bytes()[idx])
        }

        Ok(())
    }
/// Try to fill the destination buffer with random data.
///
/// # Example
///
/// ```no_run
/// use stm32wlxx_hal::{
///     pac,
///     rng::{Clk, Rng},
/// };
///
/// let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
/// let mut rng = Rng::new(dp.RNG, Clk::MSI, &mut dp.RCC);
///
/// let mut nonce: [u8; 16] = [0; 16];
/// rng.try_fill_u8(&mut nonce)?;
/// # Ok::<(), stm32wlxx_hal::rng::Error>(())
/// ```
Try to fill the destination buffer with random data.
Try to fill the destination buffer with random data .
pub fn try_fill_u8(&mut self, dest: &mut [u8]) -> Result<(), Error> {
        for chunk in dest.chunks_mut(4) {
            let mut entropy: [u32; 1] = [0];
            self.try_fill_u32(&mut entropy)?;
            chunk
                .iter_mut()
                .enumerate()
                .for_each(|(idx, byte)| *byte = entropy[0].to_be_bytes()[idx])
        }
        Ok(())
    }
pub fn try_fill_u8 ( & mut self , dest : & mut [ u8 ] ) -> Result < ( ) , Error > { for chunk in dest . chunks_mut ( 4 ) { let mut entropy : [ u32 ; 1 ] = [ 0 ] ; self . try_fill_u32 ( & mut entropy ) ? ; chunk . iter_mut ( ) . enumerate ( ) . for_each ( | ( idx , byte ) | * byte = entropy [ 0 ] . to_be_bytes ( ) [ idx ] ) } Ok ( ( ) ) }
Try to fill the destination buffer with random data.
Try to fill the destination buffer with random data .
&mut self
dest
&mut [u8]
example


let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
let mut rng = Rng::new(dp.RNG, Clk::MSI, &mut dp.RCC).


let mut dp : pac :: Peripherals = pac :: Peripherals :: take () . unwrap () ; let mut rng = Rng :: new ( dp . RNG Clk :: MSI &mut dp . RCC ) .
ok::<(), stm32wlxx_hal::rng::error>(())
None