Hello,

in the example below I am using Digest::MD5 for computing the md5-checksum
for a string. The first solution uses the function md5_hex, the second way
uses the OO method hexdigest. The results are not equal. Shouldn't they be
equal? I think they should?

------------------------------------
#!perl

use strict;
use Digest::MD5;

my $text = "bla foo \n a new line...\n";

my $cs= Digest::MD5->md5_hex($text);
print "$cs\n";

my $md5 = Digest::MD5->new;
$md5->add($text);
$cs = $md5->hexdigest;
print "$cs\n";
------------------------------------

Output:

297b58824c81ad1869c45c1cc33a378b
172b442fcbe775a552d8afda30ac6821


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to