Module zxcvbn::time_estimates

source ·
Expand description

Contains structs and methods for calculating estimated time needed to crack a given password.

Example

use zxcvbn::zxcvbn;
use zxcvbn::time_estimates::CrackTimes;

let entropy = zxcvbn("password123", &[])?;
assert_eq!(entropy.crack_times().guesses(), 596);
assert_eq!(entropy.crack_times().online_throttling_100_per_hour().to_string(), "5 hours");
assert_eq!(entropy.crack_times().online_no_throttling_10_per_second().to_string(), "59 seconds");
assert_eq!(entropy.crack_times().offline_slow_hashing_1e4_per_second().to_string(), "less than a second");
assert_eq!(entropy.crack_times().offline_fast_hashing_1e10_per_second().to_string(), "less than a second");

Structs

  • Back-of-the-envelope crack time estimations, in seconds, based on a few scenarios.

Enums