Function generate

Source
pub fn generate() -> String
Expand description

Generate a random password in the form of cvccvc-cvccvc-cvccvc, with 1 capital and 1 number replacing a letter. No L is used in the password.

The resulting password is always ascii 20 characters long.

The format matches the passwords generated by Apple’s Strong Password Suggestion, except we don’t include filtering for “bad” words. If you have a “bad” words matcher, call this function repeatedly until no bad words are found.