+2001-09-07 Gisle Aas <gisle@ActiveState.com>
+
+ Release 2.16
+
+ Sync up with the bleadperl version:
+ - use SvPVbyte() if avaiable
+ - fixes to make the code 'gcc -Wall'-clean
+
+
+
+2001-08-27 Gisle Aas <gisle@ActiveState.com>
+
+ Release 2.15
+
+ Avoid exit() in Makefile.PL and bleedperls redefinition of printf
+ in the alignment test program.
+ Patch by Doug MacEachern <dougm@covalent.net>.
+
+
+
+2001-07-18 Gisle Aas <gisle@ActiveState.com>
+
+ Release 2.14
+
+ Try to warn if the functional interface is used as methods,
+ i.e. Digest::MD5->md5_hex("foo") will make noise if -w is
+ enabled.
+
+ Document the missing padding for the base64 digests.
+
+ If both XS bootstrap and locating Digest::Perl::MD5 fails
+ reraise the original XS bootstrap exception.
+
+
+
2001-03-13 Gisle Aas <gisle@ActiveState.com>
Release 2.13
use strict;
use vars qw($VERSION @ISA @EXPORT_OK);
-$VERSION = '2.13';
+$VERSION = '2.16'; # $Date: 2001/09/07 05:45:14 $
require Exporter;
*import = \&Exporter::import;
Digest::MD5->bootstrap($VERSION);
};
if ($@) {
- # Try to load the pure perl version
- require Digest::Perl::MD5;
-
- Digest::Perl::MD5->import(qw(md5 md5_hex md5_base64));
- push(@ISA, "Digest::Perl::MD5"); # make OO interface work
+ my $olderr = $@;
+ eval {
+ # Try to load the pure perl version
+ require Digest::Perl::MD5;
+
+ Digest::Perl::MD5->import(qw(md5 md5_hex md5_base64));
+ push(@ISA, "Digest::Perl::MD5"); # make OO interface work
+ };
+ if ($@) {
+ # restore the original error
+ die $olderr;
+ }
}
else {
*reset = \&new;
Same as md5(), but will return the digest as a base64 encoded string.
+The base64 encoded string returned is not padded to be a multiple of 4
+bytes long. If you want interoperability with other base64 encoded
+md5 digests you might want to append the string "==" to the result.
+
=back
=head1 METHODS
Same as $md5->digest, but will return the digest as a base64 encoded
string.
+The base64 encoded string returned is not padded to be a multiple of 4
+bytes long. If you want interoperability with other base64 encoded
+md5 digests you might want to append the string "==" to the result.
+
=back
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
- Copyright 1998-2000 Gisle Aas.
+ Copyright 1998-2001 Gisle Aas.
Copyright 1995-1996 Neil Winton.
Copyright 1991-1992 RSA Data Security, Inc.
}
#endif
-/* Define this to turn on verbose debugging prints */
-#undef MD5_DEBUG
+#ifndef SvPVbyte
+ #define SvPVbyte SvPV
+#endif
/* Perl does not guarantee that U32 is exactly 32 bits. Some system
* has no integral type with exactly 32 bits. For instance, A Cray has
unsigned char digeststr[16];
PPCODE:
MD5Init(&ctx);
+ if (PL_dowarn && items > 1) {
+ data = (unsigned char *)SvPVbyte(ST(0), len);
+ if (len == 11 && memEQ("Digest::MD5", data, 11)) {
+ char *f = (ix == F_BIN) ? "md5" :
+ (ix == F_HEX) ? "md5_hex" : "md5_base64";
+ warn("&Digest::MD5::%s function probably called as method", f);
+ }
+ }
for (i = 0; i < items; i++) {
data = (unsigned char *)(SvPVbyte(ST(i), len));
MD5Update(&ctx, data, len);
if (ord('A') == 193) { # EBCDIC
$EXPECT = <<EOT;
-95a81f17a8e6c2273aecac12d8c4cb90 ext/Digest/MD5/MD5.pm
-9cecc5dbb27bd64b98f61f558b4db378 ext/Digest/MD5/MD5.xs
+???????????????????????????????? ext/Digest/MD5/MD5.pm
+???????????????????????????????? ext/Digest/MD5/MD5.xs
EOT
} else { # ASCII
$EXPECT = <<EOT;
-3d0146bf194e4fe68733d00fba02a49e ext/Digest/MD5/MD5.pm
-5526659171a63f532d990dd73791b60e ext/Digest/MD5/MD5.xs
+bf8c3c72d071d1c0303fc9e311820708 ext/Digest/MD5/MD5.pm
+dc50ae0aea3182f4d5f1ec368b67918b ext/Digest/MD5/MD5.xs
EOT
}
#print "$file $method\n";
open(FILE, $file) or die "Can't open $file: $!";
-# Digests avove are generated on UNIX without CRLF
+# Digests above are generated on UNIX without CRLF
# so leave handles in text mode
# binmode(FILE);
my $digest = Digest::MD5->new->addfile(*FILE)->$method();
my($file) = @_;
local $/; # slurp
open(FILE, $file) or die "Can't open $file: $!";
-# Digests avove are generated on UNIX without CRLF
+# Digests above are generated on UNIX without CRLF
# so leave handles in text mode
# binmode(FILE);
my $tmp = <FILE>;