line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer2::Plugin::Passphrase::Hashed; |
2
|
11
|
|
|
11
|
|
78
|
use strict; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
321
|
|
3
|
11
|
|
|
11
|
|
60
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
360
|
|
4
|
11
|
|
|
11
|
|
69
|
use MIME::Base64 qw(encode_base64); |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
3812
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Passphrases and Passwords as objects for Dancer2 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Dancer2::Plugin::Passphrase::Hashed - Helper package for Dancer2::Plugin::Passphrase. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 METHODS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head2 rfc2307() |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 scheme() |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head2 algorithm() |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head2 cost() |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 plaintext() |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 salt_raw() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 hash_raw() |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 salt_hex() |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 hash_hex() |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 salt_base64() |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 hash_base64() |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 AUTHOR |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Maintainer: Henk van Oers |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This software is copyright (c) 2012 by James Aitken. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
45
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub new { |
50
|
89
|
|
|
89
|
0
|
151
|
my $class = shift; |
51
|
89
|
|
|
|
|
278
|
my @args = @_; |
52
|
89
|
50
|
|
|
|
877
|
return bless { @args == 1 ? %{$args[0]} : @args }, $class; |
|
0
|
|
|
|
|
0
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
88
|
50
|
|
88
|
1
|
1290
|
sub rfc2307 { $_[0]->{'rfc2307'} || undef } |
56
|
0
|
0
|
|
0
|
1
|
0
|
sub scheme { $_[0]->{'scheme'} || undef } |
57
|
1
|
50
|
|
1
|
1
|
8
|
sub algorithm { $_[0]->{'algorithm'} || undef } |
58
|
1
|
50
|
|
1
|
1
|
8
|
sub cost { $_[0]->{'cost'} || undef } |
59
|
1
|
50
|
|
1
|
1
|
8
|
sub plaintext { $_[0]->{'plaintext'} || undef } |
60
|
3
|
50
|
|
3
|
1
|
40
|
sub salt_raw { $_[0]->{'salt'} || undef } |
61
|
2
|
50
|
|
2
|
1
|
14
|
sub hash_raw { $_[0]->{'hash'} || undef } |
62
|
3
|
|
|
3
|
1
|
19
|
sub salt_hex { unpack 'H*', $_[0]->{'salt'} } |
63
|
2
|
|
|
2
|
1
|
20
|
sub hash_hex { unpack 'H*', $_[0]->{'hash'} } |
64
|
3
|
|
|
3
|
1
|
19
|
sub salt_base64 { encode_base64( $_[0]->{'salt'}, '' ) } |
65
|
2
|
|
|
2
|
1
|
13
|
sub hash_base64 { encode_base64( $_[0]->{'hash'}, '' ) } |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |