Function chbs::passphrase[][src]

pub fn passphrase() -> String

Zero-configuration passphrase generation helper

A quick way to generate a passphrase with no configuration.
Passphrases are based on the default() of a BasicConfig, detailed properties can be found in it's documentation.

Although this crate considers the used configuration secure, your project might have different requirements. It is therefore highly recommended however to set up your own configuration to meet your requirements. This can easily be done by choosing any of the configuration structs in the config module such as BasicConfig, which has a builder available.
Or build your own configuration type with support for converting it into a Scheme by implementing the ToScheme trait.

A configuration instance is created each time this method is invoked. For generating multiple passphrases it is recommended to build a Scheme instead as it's much more performant.

Entropy

To figure out what entropy these passphrases have, use:

extern crate chbs;
use chbs::{config::BasicConfig, prelude::*};

let entropy = BasicConfig::default().to_scheme().entropy();
println!("passphrase() entropy: {:?}", entropy);