generate_key

Function generate_key 

Source
pub fn generate_key() -> String
Expand description

Generate a cryptographically secure random 64-byte key and return it as a base64 string.

This is a convenience function that generates a key and encodes it as a base64 string, useful for storage, display, or transmission. The base64 string will be 86 characters long. This function ensures the returned key does not contain any dashes (to make it double-click-selectable in GUIs).

ยงExamples

use oboron::generate_key;

let key = generate_key();
assert_eq!(key.len(), 86);