lib/Reaction/InterfaceModel/Object/User/Role/ConfirmationCodeSupport.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 22 CC 1 SCAR 6.9
CC
1
Cov
0%
generate_confirmation_code
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Reaction::InterfaceModel::Object::User::Role::ConfirmationCodeSupport;
2  
3 use Reaction::Role;
4 use Crypt::Eksblowfish::Bcrypt ();
5 use namespace::clean -except => [ qw(meta) ];
6  
7 requires 'identity_string';
8  
9 sub generate_confirmation_code {
10 my $self = shift;
11 my $salt = join(q{}, map { chr(int(rand(256))) } 1 .. 16);
12 $salt = Crypt::Eksblowfish::Bcrypt::en_base64( $salt );
13 my $settings_base = join(q{},'$2','a','$',sprintf("%02i", 8), '$');
14 return Crypt::Eksblowfish::Bcrypt::bcrypt(
15 $self->identity_string, $settings_base . $salt
16 );
17 }
18  
19 1;