pub fn fill_bytes(dest: &mut [u8])
rand-expand
rand
用随机字节填充切片。
需要启用 "rand-expand" 特性。
"rand-expand"
use lib_unknown::rand::fill_bytes; let mut buf = [0u8; 16]; fill_bytes(&mut buf); assert_eq!(buf.len(), 16);