BigGer has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I am trying to create a script to return the MD5sum of a .exe or .zip .txt etc . I am getting a value returned but it does not correspond to what an off the shelf md5sum calculators returns. Thanks in advance for your help.
.G
#! c:\\Perl\\bin\\Perl.exe use Digest::MD5 qw(md5_hex); open(FILE, "logs.txt"); my $file = <FILE>; binmode(FILE); $md5_hex = Digest::MD5->new->addfile(*FILE)->hexdigest; close(FILE); print "MD5: " . $md5_hex . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MD5 hex calculation
by talexb (Chancellor) on Apr 24, 2013 at 14:13 UTC | |
by BigGer (Novice) on Apr 24, 2013 at 14:15 UTC | |
by BigGer (Novice) on Apr 24, 2013 at 14:18 UTC | |
|
Re: MD5 hex calculation
by Anonymous Monk on Apr 24, 2013 at 14:06 UTC | |
by BigGer (Novice) on Apr 24, 2013 at 14:13 UTC | |
by Anonymous Monk on Apr 24, 2013 at 14:55 UTC |