HTTP/MD5.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 38 CC 1 SCAR 6.9
CC
1
Cov
0%
empty
2.0
parse
2.0
BEGIN
2.0
CRAP 2.0
1 # HTTP MD5 (for things like Content-MD5)
2 #
3 # subclass of HTTP::Part; see that for interface requirements
4 #
5  
6 package IDS::DataSource::HTTP::MD5;
7  
8 use strict;
9 use warnings;
10 use Carp qw(carp confess);
11 use base qw(IDS::DataSource::HTTP::Part);
12  
13 $IDS::DataSource::HTTP::MD5::VERSION = "1.0";
14  
15 sub empty {
16 my $self = shift;
17 undef $self->{"data"}, $self->{"tokens"};
18 }
19  
20 sub parse {
21 my $self = shift;
22 my $md5 = $self->{"data"}; # convenience
23 my @tokens;
24  
25 $self->mesg(1, *parse{PACKAGE} . "::parse: data '$md5'");
26
27 push @tokens, $md5 =~ /^[0-9A-Za-z+/=]{32}$/ ? "MD5" : "Invalid MD5 '$md5'";
28  
29 $self->mesg(2, *parse{PACKAGE} . "::parse: tokens\n ",
30 "\n ", \@tokens);
31 $self->{"tokens"} = \@tokens;
32 }
33  
34 # accessor functions not provided by the superclass
35  
36 =head1 AUTHOR INFORMATION
37  
38 Copyright 2005-2007, Kenneth Ingham. All rights reserved.
39  
40 This library is free software; you can redistribute it and/or modify
41 it under the same terms as Perl itself.
42  
43 Address bug reports and comments to: ids_test at i-pi.com. When sending
44 bug reports, please provide the versions of IDS::Test.pm, IDS::Algorithm.pm,
45 IDS::DataSource.pm, the version of Perl, and the name and version of the
46 operating system you are using. Since Kenneth is a PhD student, the
47 speed of the reponse depends on how the research is proceeding.
48  
49 =head1 BUGS
50  
51 Please report them.
52  
53 =head1 SEE ALSO
54  
55 L<IDS::Algorithm>, L<IDS::DataSource>
56  
57 =cut
58  
59 1;