Click here to get back home

Difference in digest and md5_hex

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Difference in digest and md5_hex gulliver 12-09-2004
Get Chitika Premium
Posted by gulliver on December 9, 2004, 5:32 pm
Please log in for more thread options
Hi, can someone explain the reason of the difference.
Here is the piece of the code.

Thanks a lot.

#!/usr/bin/perl
use Digest::MD5 qw(md5_hex);

$md5 = Digest::MD5->new;

print " md5_hex method: ", $md5->md5_hex("foobarbaz"), "n";
print "md5_hex function: ", md5_hex("foobarbaz"), "n";

$md5->add("foobarbaz");
print " Digest is: ", $md5->hexdigest, "n";

_END_

The output is:
md5_hex method: 4b725d21a782a787b0ff9c1d97cc6e55
md5_hex function: 6df23dc03f9b54cc38a0fc1483df6e21
Digest is: 6df23dc03f9b54cc38a0fc1483df6e21



Posted by Big and Blue on December 10, 2004, 1:51 am
Please log in for more thread options
gulliver wrote:
>
> Hi, can someone explain the reason of the difference.
> Here is the piece of the code.
>
> Thanks a lot.
>
> #!/usr/bin/perl
> use Digest::MD5 qw(md5_hex);
>
> $md5 = Digest::MD5->new;
>
> print " md5_hex method: ", $md5->md5_hex("foobarbaz"), "n";

According to the documentation for this module md5_hex is a function,
it is *not* a method.



--
-*- Just because I've written it here doesn't -*-
-*- mean that you should, or I do, believe it. -*-


Similar ThreadsPosted
What's the difference between /usr/(lib|share)/(perl|perl5)? March 3, 2007, 10:41 am
[ANN] Digest::SHA 5.28 (w/ shasum) November 18, 2004, 12:50 pm
Module Digest:SHA June 12, 2006, 8:00 am
LWP and Digest authentication February 8, 2007, 1:50 pm
ANNOUNCE: Digest::SHA 5.28 (w/ shasum) November 18, 2004, 7:42 pm
Q: Digest::SHA1 module cannot be loaded February 8, 2005, 5:50 pm
In search of "Digest::Nilsimsa" author March 29, 2005, 3:31 pm
Digest::SHA1 b64digest weirdness May 10, 2005, 1:33 pm
On CygwinPerl, Digest::SHA fails all tests (yet passed on CPAN-testers) May 4, 2006, 7:55 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap