ext/Digest/MD5/Makefile.PL Digest::MD5 extension makefile writer
ext/Digest/MD5/MD5.pm Digest::MD5 extension
ext/Digest/MD5/MD5.xs Digest::MD5 extension
+ext/Digest/MD5/README Digest::MD5 extension Readme
ext/Digest/MD5/t/align.t See if Digest::MD5 extension works
ext/Digest/MD5/t/badfile.t See if Digest::MD5 extension works
ext/Digest/MD5/t/files.t See if Digest::MD5 extension works
--- /dev/null
+The Digest::MD5 module allows you to use the RSA Data Security
+Inc. MD5 Message Digest algorithm from within Perl programs. The
+algorithm takes as input a message of arbitrary length and produces as
+output a 128-bit "fingerprint" or "message digest" of the input.
+MD5 is described in RFC 1321.
+
+You will need perl version 5.004 or better to install this module.
+
+Copyright 1998-2002 Gisle Aas.
+Copyright 1995-1996 Neil Winton.
+Copyright 1990-1992 RSA Data Security, Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
+}
+
print "1..5\n";
use strict;
#
# This is the output of: 'md5sum Changes README MD5.pm MD5.xs rfc1321.txt'
#
-my $EXPECT = <<EOT;
+my $EXPECT;
+
+if (ord "A" == 193) { # EBCDIC
+ $EXPECT = <<EOT;
23cafa2de11474f0df8f808cc588bcc9 Changes
3519f3d02c7c91158f732f0f00064657 README
0268931475ae2a2e843ff58504cfa3f0 MD5.pm
1be293491bba726810f8e87671ee0328 MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
+} else {
+ $EXPECT = <<EOT;
+23cafa2de11474f0df8f808cc588bcc9 Changes
+3519f3d02c7c91158f732f0f00064657 README
+0268931475ae2a2e843ff58504cfa3f0 MD5.pm
+1be293491bba726810f8e87671ee0328 MD5.xs
+754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
+EOT
+}
if (!(-f "README") && -f "../README") {
chdir("..") or die "Can't chdir: $!";
my $B64 = 1;
eval { require MIME::Base64; };
if ($@) {
- print $@;
- print "Will not test base64 methods\n";
+ print "# $@: Will not test base64 methods\n";
$B64 = 0;
}
for (split /^/, $EXPECT) {
my($md5hex, $file) = split ' ';
+ if ($ENV{PERL_CORE}) {
+ if ($file eq 'rfc1321.txt') { # Don't have it in core.
+ print "ok ", ++$testno, " # Skip: PERL_CORE\n";
+ next;
+ }
+ use File::Spec;
+ my @path = qw(ext Digest MD5);
+ my $path = File::Spec->updir;
+ while (@path) {
+ $path = File::Spec->catdir($path, shift @path);
+ }
+ $file = File::Spec->catfile($path, $file);
+ }
+# print "# file = $file\n";
my $md5bin = pack("H*", $md5hex);
my $md5b64;
if ($B64) {
chop($md5b64); chop($md5b64); # remove padding
}
my $failed;
+ my $got;
if (digest_file($file, 'digest') ne $md5bin) {
print "$file: Bad digest\n";
$failed++;
}
- if (digest_file($file, 'hexdigest') ne $md5hex) {
- print "$file: Bad hexdigest\n";
+ if (($got = digest_file($file, 'hexdigest')) ne $md5hex) {
+ print "$file: Bad hexdigest: got $got expected $md5hex\n";
$failed++;
}