Skip to main content

generate_random_bytes

Function generate_random_bytes 

Source
pub fn generate_random_bytes(len: usize) -> Vec<u8> 
Expand description

生成随机 salt/IV 字节。

使用 sha2 + 时间戳 + 计数器作为伪随机源(不依赖 rand crate, 保持库依赖最小化。安全性由 SHA-512 的不可逆性保证)。