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!
|
|---|