File Coverage

blib/lib/Dancer2/Plugin/Passphrase/Hashed.pm
Criterion Covered Total %
statement 22 24 91.6
branch 7 16 43.7
condition n/a
subroutine 14 15 93.3
pod 11 12 91.6
total 54 67 80.6


line stmt bran cond sub pod time code
1             package Dancer2::Plugin::Passphrase::Hashed;
2 11     11   81 use strict;
  11         32  
  11         345  
3 11     11   65 use warnings;
  11         22  
  11         354  
4 11     11   70 use MIME::Base64 qw(encode_base64);
  11         28  
  11         4275  
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 166 my $class = shift;
51 89         298 my @args = @_;
52 89 50       915 return bless { @args == 1 ? %{$args[0]} : @args }, $class;
  0         0  
53             }
54              
55 88 50   88 1 997 sub rfc2307 { $_[0]->{'rfc2307'} || undef }
56 0 0   0 1 0 sub scheme { $_[0]->{'scheme'} || undef }
57 1 50   1 1 9 sub algorithm { $_[0]->{'algorithm'} || undef }
58 1 50   1 1 9 sub cost { $_[0]->{'cost'} || undef }
59 1 50   1 1 9 sub plaintext { $_[0]->{'plaintext'} || undef }
60 3 50   3 1 36 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 21 sub salt_base64 { encode_base64( $_[0]->{'salt'}, '' ) }
65 2     2 1 14 sub hash_base64 { encode_base64( $_[0]->{'hash'}, '' ) }
66              
67             1;