File Coverage

blib/lib/ElasticSearchX/Model/Util.pm
Criterion Covered Total %
statement 9 13 69.2
branch n/a
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 18 66.6


line stmt bran cond sub pod time code
1             #
2             # This file is part of ElasticSearchX-Model
3             #
4             # This software is Copyright (c) 2016 by Moritz Onken.
5             #
6             # This is free software, licensed under:
7             #
8             # The (three-clause) BSD License
9             #
10             package ElasticSearchX::Model::Util;
11             $ElasticSearchX::Model::Util::VERSION = '1.0.2';
12 7     7   27 use strict;
  7         7  
  7         158  
13 7     7   20 use warnings;
  7         7  
  7         122  
14              
15 7     7   22 use Digest::SHA1;
  7         6  
  7         550  
16              
17             sub digest {
18 0     0 0   my $digest = join( "\0", @_ );
19 0           $digest = Digest::SHA1::sha1_base64($digest);
20 0           $digest =~ tr/[+\/]/-_/;
21 0           return $digest;
22             }
23              
24             1;
25              
26             __END__
27              
28             =pod
29              
30             =encoding UTF-8
31              
32             =head1 NAME
33              
34             ElasticSearchX::Model::Util
35              
36             =head1 VERSION
37              
38             version 1.0.2
39              
40             =head1 AUTHOR
41              
42             Moritz Onken
43              
44             =head1 COPYRIGHT AND LICENSE
45              
46             This software is Copyright (c) 2016 by Moritz Onken.
47              
48             This is free software, licensed under:
49              
50             The (three-clause) BSD License
51              
52             =cut