Skip to main content

generate_key

Function generate_key 

Source
pub fn generate_key() -> Key
Expand description

Generate a cryptographically secure random 64-byte Key.

Equivalent to Key::random; kept as a free function for ergonomic parity with oboron::generate_key (which returns a hex-encoded string instead of a Key).

ยงExamples

let key = obcrypt::generate_key();
assert_eq!(key.as_bytes().len(), 64);