against the L<Python
port's|https://github.com/dwolfhub/zxcvbn-python>
F<password_expected_value.json> test. When the dictionaries contain
exactly the same data (including some words that are loaded
s
=back
All the objects in the returned value can be serialised to JSON, if
you set C<convert_blessed> or equivalent in your JSON library.
=head3 Options
my $strength = password_strength($passwo
ions {
return [ 'Avoid dates and years that are associated with you' ];
}
around fields_for_json => sub {
my ($orig,$self) = @_;
( $self->$orig(), qw(year separator) )
};
1;
__END__
=
>
=head2 C<feedback_suggestions>
This class suggests not using dates.
=head2 C<fields_for_json>
The JSON serialisation for matches of this class will contain C<token
i j guesses guesses_log10 year
'@' instead of 'a' don't help very much};
}
return \@suggestions;
}
around fields_for_json => sub {
my ($orig,$self) = @_;
( $self->$orig(), qw(dictionary_name reversed rank substi
cters"
substitutions, and writing things backwards are not very useful.
=head2 C<fields_for_json>
The JSON serialisation for matches of this class will contain C<token
i j guesses guesses_log10 dict
'Avoid years that are associated with you' )
: (),
];
}
around fields_for_json => sub {
my ($orig,$self) = @_;
( $self->$orig(), qw(regex_name) )
};
1;
__END__
=pod
ing recent years. At the moment, there's no
feedback for other regexes.
=head2 C<fields_for_json>
The JSON serialisation for matches of this class will contain C<token
i j guesses guesses_log10 rege
elta;
}
$update->($i,$length-1,$last_delta);
return \@matches;
}
around fields_for_json => sub {
my ($orig,$self) = @_;
( $self->$orig(), qw(ascending) )
};
1;
__END__
=pod
nces of characters whose codepoints
increase or decrease by a constant.
=head2 C<fields_for_json>
The JSON serialisation for matches of this class will contain C<token
i j guesses guesses_log10 asce
ggestions {
return [ 'Use a longer keyboard pattern with more turns' ];
}
around fields_for_json => sub {
my ($orig,$self) = @_;
( $self->$orig(), qw(graph_name shifted_count turns) )
};
d patterns are easy to guess,
and to use longer and less straight ones.
=head2 C<fields_for_json>
The JSON serialisation for matches of this class will contain C<token
i j guesses guesses_log10 grap
eedback_suggestions {
return [ 'Avoid repeated words and characters' ];
}
around fields_for_json => sub {
my ($orig,$self) = @_;
( $self->$orig(), qw(repeat_count base_guesses base_token
C<feedback_suggestions>
This class suggests not to repeat substrings.
=head2 C<fields_for_json>
The JSON serialisation for matches of this class will contain C<token
i j guesses guesses_log10 repe
fields_for_json { qw(token i j guesses guesses_log10) }
sub TO_JSON {
my ($self) = @_;
return {
class => ref($self),
map { $_ => $self->$_ } $self->fields_for_json,
};
}
=back
=head2 C<TO_JSON>
=head2 C<fields_for_json>
Matches can be serialised to JSON. The serialisation will be a
dictionary with all the fields returned by L<< /C<fields_for_json>
>>. By default, i