Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: MD5 Peculiarities

by skazat (Chaplain)
on Jun 22, 2003 at 07:12 UTC ( [id://267929]=note: print w/replies, xml ) Need Help??


in reply to MD5 Peculiarities

To make this even more simpler to understand, here is a module, called, "CheckSum.pm":

package MOJO::MailingList::Schedules::CheckSum; sub new { my $class = shift; my %args = (@_); my $self = {}; bless $self, $class; return $self; } use Digest::MD5; sub checksum { my $self = shift; my $data = shift; my $ctx = Digest::MD5->new; return $ctx->md5_hex("foobarbaz"); } 1;

(NOTE: it will always make the checksum from "foobarbaz" )Here is a script that tests this module:

require MOJO::MailingList::Schedules::CheckSum; my $cs = MOJO::MailingList::Schedules::CheckSum->new(); print $cs->checksum("foobarbaz") ."\n";

That script prints out, "d79e1dc81fb80407e0824bf7854b7544",

When almost the exact code is put into another script:

sub create_checksum { my $self = shift; my $data = shift; require MOJO::MailingList::Schedules::CheckSum; my $cs = MOJO::MailingList::Schedules::CheckSum->new(); return $cs->checksum("foobarbaz") ."\n"; }

this returns all sorts of things, a few of the checksums I've received:

203156774c6b5b2300971c5abed8f0d6
46b8a55039b48cac0955106b0987a3d
6f0e7e2d63ce536cc381698a9f6a9524

I'm pretty stumped on why I'm receiving this. Oy.. It must be because of something else in that module, but what? and why? Again, I would post the module, but it's almost 800 lines long and the script that calls it is 1500.

 

-justin simoni
!skazat!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://267929]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found