File Coverage

blib/lib/Mojolicious/Sessions/ThreeS/SidGen/Simple.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Mojolicious::Sessions::ThreeS::SidGen::Simple;
2             $Mojolicious::Sessions::ThreeS::SidGen::Simple::VERSION = '0.002';
3 2     2   6 use Mojo::Base qw/Mojolicious::Sessions::ThreeS::SidGen/;
  2         2  
  2         8  
4              
5 2     2   183 use Digest::SHA qw//;
  2         2  
  2         128  
6              
7             =head1 NAME
8              
9             Mojolicious::Sessions::ThreeS::SidGen::Simple - A simple and fast Session ID generation.
10              
11             =cut
12              
13             =head2 generate_sid
14              
15             See L
16              
17             =cut
18              
19             sub generate_sid{
20 4     4 1 19 my ($self, $controller) = @_;
21 4         31 return Digest::SHA::sha256_hex( rand() . $$ . {} . time );
22             }
23              
24             1;
25