line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Sessions::ThreeS::SidGen::Simple; |
2
|
|
|
|
|
|
|
$Mojolicious::Sessions::ThreeS::SidGen::Simple::VERSION = '0.004'; |
3
|
2
|
|
|
2
|
|
7
|
use Mojo::Base qw/Mojolicious::Sessions::ThreeS::SidGen/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
9
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
181
|
use Digest::SHA qw//; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
126
|
|
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
|
23
|
my ($self, $controller) = @_; |
21
|
4
|
|
|
|
|
46
|
return Digest::SHA::sha256_hex( rand() . $$ . {} . time ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|