[][src]Function passablewords::check_entropy

pub fn check_entropy(password: &str) -> PassablewordResult

Check a password to make sure random enough that it would take a lot of effort to crack/guess. This uses the awesome zxcvbn library behind the scenes.

Example (using rocket.rs)

match check_entropy(password) {
    Ok() => status::Ok
    Err(err) => match(err) {
        PassablewordResult::TooSimple => status::BadRequest("Your should be more random")
    }
}