[Orca-checkins] rev 188 - in trunk/orca: . packages packages/Digest-MD5-2.22 packages/Digest-MD5-2.22/t

blair at orcaware.com blair at orcaware.com
Mon Jan 6 11:50:36 PST 2003


Author: blair
Date: 2003-01-06 11:50:23 -0800 (Mon, 06 Jan 2003)
New Revision: 188

Added:
   trunk/orca/packages/Digest-MD5-2.22/
   trunk/orca/packages/Digest-MD5-2.22/t/clone.t
Removed:
   trunk/orca/packages/Digest-MD5-2.21/
Modified:
   trunk/orca/INSTALL
   trunk/orca/configure.in
   trunk/orca/packages/Digest-MD5-2.22/Changes
   trunk/orca/packages/Digest-MD5-2.22/MANIFEST
   trunk/orca/packages/Digest-MD5-2.22/MD5.pm
   trunk/orca/packages/Digest-MD5-2.22/MD5.xs
   trunk/orca/packages/Digest-MD5-2.22/README
   trunk/orca/packages/Digest-MD5-2.22/t/files.t
Log:
Upgrade Digest::MD5 from 2.21 to 2.22 and require the new version for
Orca.

* INSTALL:
  Update all references to Digest::MD5's version number from 2.21 to
  2.22.

* configure.in:
  Bump Digest::MD5's version number to 2.22.

* packages/Digest-MD5-2.22:
  Renamed from packages/Digest-MD5-2.21.  Directory contents updated
  from Digest-MD5-2.22.tar.gz.


Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	2003-01-06 11:50:35.000000000 -0800
@@ -31,8 +31,8 @@
 DATA_DUMPER_VER=2.101
 DATE_PARSE_DIR=TimeDate-1.14
 DATE_PARSE_VER=2.24
-DIGEST_MD5_DIR=Digest-MD5-2.21
-DIGEST_MD5_VER=2.21
+DIGEST_MD5_DIR=Digest-MD5-2.22
+DIGEST_MD5_VER=2.22
 MATH_INTERVALSEARCH_DIR=Math-Interpolate-1.05
 MATH_INTERVALSEARCH_VER=1.05
 RRDTOOL_DIR=rrdtool-1.0.40

Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL	(original)
+++ trunk/orca/INSTALL	2003-01-06 11:50:35.000000000 -0800
@@ -160,7 +160,7 @@
     Name                        Required Version        Included With Orca
     ----------------------------------------------------------------------
     Data::Dumper                2.101 or greater        2.101
-    Digest::MD5                 2.21 or greater         2.21
+    Digest::MD5                 2.22 or greater         2.22
     Math::IntervalSearch        1.05 or greater         1.05
     RRDs                        1.0.33 or greater       1.0.33
     Storable                    2.06 or greater         2.06
@@ -191,10 +191,10 @@
 
     Digest::MD5
 
-      http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.21.tar.gz
+      http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.22.tar.gz
 
-      % gunzip -c Digest-MD5-2.21.tar.gz | tar xvf -
-      % cd Digest-MD5-2.21
+      % gunzip -c Digest-MD5-2.22.tar.gz | tar xvf -
+      % cd Digest-MD5-2.22
       % perl Makefile.PL
       % make
       % make test

Copied: Digest-MD5-2.22 (from rev 187, trunk/orca/packages/Digest-MD5-2.21)

Modified: trunk/orca/packages/Digest-MD5-2.22/MD5.pm
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/MD5.pm	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/MD5.pm	2003-01-06 11:50:35.000000000 -0800
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION @ISA @EXPORT_OK);
 
-$VERSION = '2.21';  # $Date: 2002/12/28 05:30:03 $
+$VERSION = '2.22';  # $Date: 2003/01/05 00:56:14 $
 
 require Exporter;
 *import = \&Exporter::import;
@@ -117,6 +117,14 @@
 state the object to the state of a newly created object.  No new
 object is created in this case.
 
+=item $md5->clone
+
+This is a copy constructor returning a clone of the $md5 object. It is
+useful when you do not want to destroy the digests state, but need an
+intermediate value of the digest, e.g. when calculating digests
+iteratively on a continuous data stream in order to obtain a copy which
+may be destroyed.
+
 =item $md5->reset
 
 This is just an alias for $md5->new.
@@ -142,7 +150,8 @@
 Note that the C<digest> operation is effectively a destructive,
 read-once operation. Once it has been performed, the C<Digest::MD5>
 object is automatically C<reset> and can be used to calculate another
-digest value.
+digest value.  Call $md5->clone->digest if you want to calculate the
+digest without reseting the digest state.
 
 =item $md5->hexdigest
 
@@ -253,7 +262,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
 
- Copyright 1998-2002 Gisle Aas.
+ Copyright 1998-2003 Gisle Aas.
  Copyright 1995-1996 Neil Winton.
  Copyright 1991-1992 RSA Data Security, Inc.
 

Added: trunk/orca/packages/Digest-MD5-2.22/t/clone.t
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/t/clone.t	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/t/clone.t	2003-01-06 11:50:35.000000000 -0800
@@ -0,0 +1,41 @@
+#!perl -w
+
+print "1..6\n";
+
+use strict;
+use Digest::MD5 qw(md5_hex);
+
+my $a = Digest::MD5->new;
+$a->add("a");
+my $b = $a->clone;
+
+print "not " unless $b->clone->hexdigest eq md5_hex("a");
+print "ok 1\n";
+
+$a->add("a");
+print "not " unless $a->hexdigest eq md5_hex("aa");
+print "ok 2\n";
+
+print "not " unless $a->hexdigest eq md5_hex("");
+print "ok 3\n";
+
+$b->add("b");
+print "not " unless $b->clone->hexdigest eq md5_hex("ab");
+print "ok 4\n";
+
+$b->add("c");
+print "not " unless $b->clone->hexdigest eq md5_hex("abc");
+print "ok 5\n";
+
+# Test that cloning picks up the correct class for subclasses.
+{
+   package MD5;
+   @MD5::ISA = qw(Digest::MD5);
+}
+
+$a = MD5->new;
+$a->add("a");
+$b = $a->clone;
+
+print "not " unless ref($b) eq "MD5" && $b->add("b")->hexdigest eq md5_hex("ab");
+print "ok 6\n";

Modified: trunk/orca/packages/Digest-MD5-2.22/t/files.t
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/t/files.t	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/t/files.t	2003-01-06 11:50:35.000000000 -0800
@@ -20,27 +20,27 @@
 my $EXPECT;
 if (ord "A" == 193) { # EBCDIC
     $EXPECT = <<EOT;
-36158997c99f2e1396ee40ddc4634a40  Changes
-5a591a47e8c40fe4b78c744111511c45  README
-770a5ef28ab15e66355639f21152afb0  MD5.pm
-4850753428db9422e8e5f97b401d5a13  MD5.xs
+ed8efe2e2dbab62fcc9dea2df6682569  Changes
+0565ec21b15c0f23f4c51fb327c8926d  README
+0fcdd6d6e33b8772bd4b4832043035cd  MD5.pm
+d7fd24455b9160aa8706635d15e6177e  MD5.xs
 276da0aa4e9a08b7fe09430c9c5690aa  rfc1321.txt
 EOT
 } elsif ("\n" eq "\015") { # MacOS
     $EXPECT = <<EOT;
-e68b13fe9edf36fe13551bf410b7a745  Changes
-3519f3d02c7c91158f732f0f00064657  README
-4113db8afad83eb7c01f1bf2c53e66ee  MD5.pm
-1be293491bba726810f8e87671ee0328  MD5.xs
+2879619f967d5fc5a00ffe37b639f2ee  Changes
+6c950a0211a5a28f023bb482037698cd  README
+4e1043f0a7a266416d8408d6fa96f454  MD5.pm
+6bff95ff70ba43a6c81e255c6510a865  MD5.xs
 754b9db19f79dbc4992f7166eb0f37ce  rfc1321.txt
 EOT
 } else {
     # This is the output of: 'md5sum Changes README MD5.pm MD5.xs rfc1321.txt'
     $EXPECT = <<EOT;
-e68b13fe9edf36fe13551bf410b7a745  Changes
-3519f3d02c7c91158f732f0f00064657  README
-4113db8afad83eb7c01f1bf2c53e66ee  MD5.pm
-1be293491bba726810f8e87671ee0328  MD5.xs
+2879619f967d5fc5a00ffe37b639f2ee  Changes
+6c950a0211a5a28f023bb482037698cd  README
+4e1043f0a7a266416d8408d6fa96f454  MD5.pm
+6bff95ff70ba43a6c81e255c6510a865  MD5.xs
 754b9db19f79dbc4992f7166eb0f37ce  rfc1321.txt
 EOT
 }

Modified: trunk/orca/packages/Digest-MD5-2.22/MANIFEST
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/MANIFEST	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/MANIFEST	2003-01-06 11:50:35.000000000 -0800
@@ -10,6 +10,7 @@
 rfc1321.txt		The MD5 Message-Digest Algorithm
 t/align.t		Try unaligned memory blocks
 t/badfile.t             Try addfile() on unopened file
+t/clone.t		Try clone() method.
 t/files.t		Check a few files.
 t/md5-aaa.t		Exercise padding code
 t/utf8.t		Try some Unicode strings

Modified: trunk/orca/packages/Digest-MD5-2.22/Changes
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/Changes	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/Changes	2003-01-06 11:50:35.000000000 -0800
@@ -1,3 +1,12 @@
+2002-03-04   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.22.
+
+   Added clone method.
+   Contributed by Holger Smolinski <holger at kunterbunt.bb.bawue.de>
+
+
+
 2002-12-27   Gisle Aas <gisle at ActiveState.com>
 
    Release 2.21

Modified: trunk/orca/packages/Digest-MD5-2.22/README
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/README	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/README	2003-01-06 11:50:35.000000000 -0800
@@ -6,7 +6,7 @@
 
 You will need perl version 5.004 or better to install this module.
 
-Copyright 1998-2002 Gisle Aas.
+Copyright 1998-2003 Gisle Aas.
 Copyright 1995-1996 Neil Winton.
 Copyright 1990-1992 RSA Data Security, Inc.
 

Modified: trunk/orca/packages/Digest-MD5-2.22/MD5.xs
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.21/MD5.xs	(original)
+++ trunk/orca/packages/Digest-MD5-2.22/MD5.xs	2003-01-06 11:50:35.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: MD5.xs,v 1.34 2002/05/01 23:30:28 gisle Exp $ */
+/* $Id: MD5.xs,v 1.35 2003/01/05 00:54:17 gisle Exp $ */
 
 /* 
  * This library is free software; you can redistribute it and/or
@@ -562,6 +562,22 @@
 	XSRETURN(1);
 
 void
+clone(self)
+	SV* self
+    PREINIT:
+	MD5_CTX* cont = get_md5_ctx(self);
+	char *myname = sv_reftype(SvRV(self),TRUE);
+	MD5_CTX* context;
+    PPCODE:
+	STRLEN my_na;
+	New(55, context, 1, MD5_CTX);
+	ST(0) = sv_newmortal();
+	sv_setref_pv(ST(0), myname , (void*)context);
+	SvREADONLY_on(SvRV(ST(0)));
+	memcpy(context,cont,sizeof(MD5_CTX));
+	XSRETURN(1);
+
+void
 DESTROY(context)
 	MD5_CTX* context
     CODE:



More information about the Orca-checkins mailing list