File Coverage

blib/lib/Set/Associate/NewKey/HashMD5.pm
Criterion Covered Total %
statement 20 21 95.2
branch n/a
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 28 30 93.3


line stmt bran cond sub pod time code
1 4     4   1003 use 5.006;
  4         9  
2 4     4   20 use strict;
  4         6  
  4         113  
3 4     4   27 use warnings;
  4         6  
  4         278  
4              
5             package Set::Associate::NewKey::HashMD5;
6              
7             # ABSTRACT: Pick a value from the pool based on the MD5 value of the key
8              
9             our $VERSION = '0.004001';
10              
11             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
12              
13 4     4   595 use Moose qw( around extends );
  4         408319  
  4         26  
14 4     4   16710 use Digest::MD5;
  4         7  
  4         218  
15 4     4   2135 use bigint 0.22 qw( hex );
  4         10778  
  4         22  
16             extends 'Set::Associate::NewKey::PickOffset';
17              
18              
19              
20              
21              
22              
23              
24 0     0 1   sub name { 'hash_md5' }
25             around get_assoc => sub {
26             my ( $orig, $self, $sa, $key ) = @_;
27              
28             return $self->$orig( $sa, hex Digest::MD5::md5_hex($key) );
29             };
30              
31             __PACKAGE__->meta->make_immutable;
32              
33 4     4   118234 no Moose;
  4         20  
  4         39  
34              
35             1;
36              
37             __END__
38              
39             =pod
40              
41             =encoding UTF-8
42              
43             =head1 NAME
44              
45             Set::Associate::NewKey::HashMD5 - Pick a value from the pool based on the MD5 value of the key
46              
47             =head1 VERSION
48              
49             version 0.004001
50              
51             =head1 METHODS
52              
53             =head2 name
54              
55             The name of this key assignment method ( C<hash_md5> )
56              
57             =head1 AUTHOR
58              
59             Kent Fredric <kentnl@cpan.org>
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut