[][src]Function sodiumoxide::crypto::stream::chacha20::gen_nonce

pub fn gen_nonce() -> Nonce

gen_nonce() randomly generates a nonce for symmetric encryption

THREAD SAFETY: gen_nonce() is thread-safe provided that you have called sodiumoxide::init() once before using any other function from sodiumoxide.

NOTE: When using primitives with short nonces (e.g. salsa20, salsa208, salsa2012) do not use random nonces since the probability of nonce-collision is not negligible