lib/Archive/BagIt/Plugin/BLAKE3.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.0% 18 / 20 CC 1 SCAR 0.6
CC
1
Cov
87%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
↑ Summary blib/lib/Archive/BagIt/Plugin/_Deparsed_XSubs.pm »
1 package Archive::BagIt::Plugin::BLAKE3;
2  
3 our $VERSION = '0.003';
4 # ABSTRACT: The Blake3 algorithm plugin
5  
6  
7 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 0 ▶use Digest::BLAKE3;
Subroutine BEGIN: called CC=1 SCAR=2.6
12 use namespace::autoclean;
13 with 'Archive::BagIt::Role::Algorithm',
14 'Archive::BagIt::Role::Manifest';
15  
16 has '+name' => (
17 is => 'ro',
18 #isa => 'Str',
19 default => 'blake3',
20 );
21  
22  
23 sub get_hash_string {
24 my ($self, $fh) = @_;
25 my $hasher = Digest::BLAKE3::->new();
26 $hasher->addfile($fh);
27 my $hash = $hasher->digest();
28 return unpack('H*', $hash);
29 }
30  
31 sub BUILD {
32 my ($self) = @_;
33 $self->bagit->plugins( $self->plugin_name => $self );
34 return 1;
35 }
36  
37 __PACKAGE__->meta->make_immutable;
38  
39 1;
40  
41 __END__
↑ Summary blib/lib/Archive/BagIt/Plugin/_Deparsed_XSubs.pm »