Skip to main content

gen_access_key

Function gen_access_key 

Source
pub fn gen_access_key(length: usize) -> Result<String>
Expand description

Generates a random access key of the specified length.

§Arguments

  • length - The length of the access key to generate

§Returns

  • Result<String> - A result containing the generated access key or an error if the length is too short

§Errors

This function will return an error if the specified length is less than 3.

Examples

use rustfs_credentials::gen_access_key;

let access_key = gen_access_key(16).unwrap();
println!("Generated access key: {}", access_key);