[][src]Function mkpasswd::mkpasswd

pub fn mkpasswd() -> String

Generates an UTF-8 valid password with a length of 32 characters.

Only the first call to this function initializes a random number generator.

Internally, the Password set is used.

Panics

This functions panics if the secure random number generator can not be created or the generator fails.

Example

use mkpasswd::mkpasswd;

println!("Password 1: {}", mkpasswd());
println!("Password 2: {}", mkpasswd());
println!("Password 3: {}", mkpasswd());

assert_eq!(mkpasswd().len(), 32);