blob: bf79eefd76b1b76f968b93ec8fb545f3e941e774 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package Reaction::InterfaceModel::Action::User::Role::ConfirmationCodeSupport;
use Reaction::Role;
use Crypt::Eksblowfish::Bcrypt ();
use namespace::clean -except => [ qw(meta) ];
sub generate_confirmation_code {
my $self = shift;
my $salt = join(q{}, map { chr(int(rand(256))) } 1 .. 16);
$salt = Crypt::Eksblowfish::Bcrypt::en_base64( $salt );
my $settings_base = join(q{},'$2','a','$',sprintf("%02i", 8), '$');
return Crypt::Eksblowfish::Bcrypt::bcrypt(
$self->identity_string, $settings_base . $salt
);
}
1;
|