Data::Password::zxcvbn::MatchList - a collection of matches for a password
version 1.0.1
use Data::Password::zxcvbn::MatchList; my $list = Data::Password::zxcvbn::MatchList->omnimatch($password) ->most_guessable_match_list;
zxcvbn estimates the strength of a password by guessing which way a generic password cracker would produce it, and then guessing after how many tries it would produce it.
This class represents a list of guesses ("matches"), covering different substrings of a password.
password
Required string, the password this list is about.
matches
Arrayref, the actual list of matches.
guesses
The estimated number of attempts that a generic password cracker would need to guess the whole "password". This will be set for objects returned by "most_guessable_match_list", not for those returned by "omnimatch".
most_guessable_match_list
omnimatch
my $match_list = Data::Password::zxcvbn::MatchList->omnimatch($password,\%opts);
Main constructor (the name comes from the original JS implementation). Calls ->make($password,\%opts) on all the Data::Password::zxcvbn::Match::* classes (or the ones in @{$opts{modules}}), combines all the matches, and returns a MatchList holding them.
->make($password,\%opts)
Data::Password::zxcvbn::Match::*
@{$opts{modules}}
MatchList
my $minimal_list = $match_list->most_guessable_match_list;
This method extracts, from the "matches" of the invocant, a list of non-overlapping matches with minimum guesses. That list should represent the way that a generic password cracker would guess the "password", and as such is the one that the "Data::Password::zxcvbn/password_strength" in main function will use.
guesses_log10
The logarithm in base 10 of "guesses".
score
my $score = $match_list->score;
Returns an integer from 0-4 (useful for implementing a strength bar). See Data::Password::zxcvbn::TimeEstimate::guesses_to_score.
Data::Password::zxcvbn::TimeEstimate::guesses_to_score
get_feedback
my %feedback = %{ $match_list->get_feedback };
Collects all the feedback from the "matches", and returns it.
Gianni Ceccarelli <gianni.ceccarelli@broadbean.com>
This software is copyright (c) 2018 by BroadBean UK, a CareerBuilder Company.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Password::zxcvbn, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Password::zxcvbn
CPAN shell
perl -MCPAN -e shell install Data::Password::zxcvbn
For more information on module installation, please visit the detailed CPAN module installation guide.