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) 2019 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 = '2.0.1';
12 7     7   48 use strict;
  7         15  
  7         207  
13 7     7   34 use warnings;
  7         15  
  7         181  
14              
15 7     7   3418 use Digest::SHA;
  7         18030  
  7         873  
16              
17             sub digest {
18 0     0 0   my $digest = join( "\0", @_ );
19 0           $digest = Digest::SHA::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 2.0.1
39              
40             =head1 AUTHOR
41              
42             Moritz Onken
43              
44             =head1 COPYRIGHT AND LICENSE
45              
46             This software is Copyright (c) 2019 by Moritz Onken.
47              
48             This is free software, licensed under:
49              
50             The (three-clause) BSD License
51              
52             =cut