6 $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl";
7 eval "require $MODULE" || die $@;
8 $MODULE->import(qw(sha1_hex));
12 if ($ENV{PERL_CORE}) {
18 my @vecs = map { eval } <DATA>;
19 $#vecs -= 2 if $MODULE eq "Digest::SHA::PurePerl";
21 my $numtests = scalar(@vecs) / 2;
22 print "1..$numtests\n";
24 for (1 .. $numtests) {
25 my $data = shift @vecs;
26 my $digest = shift @vecs;
27 print "not " unless sha1_hex($data) eq $digest;
28 print "ok ", $_, "\n";
33 "a9993e364706816aba3e25717850c26c9cd0d89d"
34 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
35 "84983e441c3bd26ebaae4aa1f95129e5e54670f1"
37 "34aa973cd4c4daa4f61eeb2bdbad27316534016f"