blib/lib/Data/Token.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 92.8% 26 / 28 CC 1 SCAR 0.4
CC
1
Cov
90%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Data::Token;
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use version; our $VERSION = qv('0.0.3');
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Data::UUID;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Digest::SHA qw(sha1_hex);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use base qw/Exporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 0 ▶use Crypt::Random qw( makerandom );
Subroutine BEGIN: called CC=1 SCAR=2.6
9 our @EXPORT = qw/token/;
10  
11 sub token {
12 our $uuid ||= new Data::UUID;
13 our $secret ||= makerandom ( Size => 512, Strength => 0 );
14 return sha1_hex($uuid->create_str() . $secret);
15 }
16  
17 1; # Magic true value required at end of module
18 __END__
↑ Summary