From: Jarkko Hietaniemi Date: Mon, 20 Jan 2003 17:48:51 +0000 (+0000) Subject: Upgrade to Digest 1.02. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=67859229b2af3ba90e55d42060c363e9c83849bf;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Digest 1.02. p4raw-id: //depot/perl@18523 --- diff --git a/lib/Digest.pm b/lib/Digest.pm index 4ad93ff..8ebf61a 100644 --- a/lib/Digest.pm +++ b/lib/Digest.pm @@ -3,7 +3,7 @@ package Digest; use strict; use vars qw($VERSION %MMAP $AUTOLOAD); -$VERSION = "1.01"; +$VERSION = "1.02"; %MMAP = ( "SHA-1" => "Digest::SHA1", @@ -124,7 +124,7 @@ load the right module on first use. The second form allow you to use algorithm names which contains letters which are not legal perl identifiers, e.g. "SHA-1". -If new() is called as a instance method (i.e. $ctx->new) it will just +If new() is called as an instance method (i.e. $ctx->new) it will just reset the state the object to the state of a newly created object. No new object is created in this case, and the return value is the reference to the object (i.e. $ctx). diff --git a/lib/Digest.t b/lib/Digest.t index 5741b77..fbc2dac 100644 --- a/lib/Digest.t +++ b/lib/Digest.t @@ -1,13 +1,9 @@ print "1..3\n"; -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use Digest; -my $hexdigest = "900150983cd24fb0d6963f7d28e17f72"; +my $hexdigest = "900150983cd24fb0d6963f7d28e17f72"; # ASCII + if (ord('A') == 193) { # EBCDIC $hexdigest = "fe4ea0d98f9cd8d1d27f102a93cb0bb0"; # IBM-1047 } @@ -19,6 +15,7 @@ print "not " unless Digest->MD5->add("abc")->hexdigest eq $hexdigest; print "ok 2\n"; eval { + # Not yet EBCDICified. print "not " unless Digest->new("HMAC-MD5" => "Jefe")->add("what do ya want for nothing?")->hexdigest eq "750c783e6ab0b503eaa86e310a5db738"; print "ok 3\n"; };