Skip to main content

fill_bytes

Function fill_bytes 

Source
pub fn fill_bytes(dest: &mut [u8])
Available on crate features rand-expand and rand only.
Expand description

用随机字节填充切片。

§Feature Requirement

需要启用 "rand-expand" 特性。

§Examples

use lib_unknown::rand::fill_bytes;

let mut buf = [0u8; 16];
fill_bytes(&mut buf);
assert_eq!(buf.len(), 16);