diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Digest.pm | 4 | ||||
-rw-r--r-- | lib/Digest.t | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/Digest.pm b/lib/Digest.pm index 4ad93ff40a..8ebf61a487 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 5741b777fe..fbc2dac805 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"; }; |