MCPcopy Create free account
hub / github.com/evilsocket/cake / random_nonce

Function random_nonce

cake-core/src/cake/sharding/auth.rs:33–37  ·  view source on GitHub ↗

Generate a random 32-byte nonce.

()

Source from the content-addressed store, hash-verified

31
32/// Generate a random 32-byte nonce.
33fn random_nonce() -> [u8; NONCE_SIZE] {
34 let mut nonce = [0u8; NONCE_SIZE];
35 rand::thread_rng().fill_bytes(&mut nonce);
36 nonce
37}
38
39/// Constant-time comparison of two byte slices.
40pub fn constant_time_eq(a: &[u8], b: &[u8]) -> bool {

Callers 2

authenticate_as_masterFunction · 0.85
authenticate_as_workerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected