Tuna has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Digest::MD5; my %local; my $file = shift || "/etc/passwd"; open(FILE, $file) or die "Can't open '$file': $!"; binmode(FILE); my $md5 = Digest::MD5->new; while (<FILE>) { $md5->add($_); } close FILE; $local{$file} = $md5->b64digest; foreach my $k(keys %local) { print "Key = $k\nValue = $local{$k}\n\n"; } print $md5->b64digest, " $file\n";
The above prints:
Key = /etc/passwd Value = Z+9+EFlyq2r1T90U9TiCiA 1B2M2Y8AsgTpgAmY7PhCfg /etc/passwd
Why would the fingerprint values be different?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ichimunki) Re: Digest::MD5 Bug?
by ichimunki (Priest) on Aug 15, 2001 at 21:16 UTC | |
|
Re: Digest::MD5 Bug?
by Hofmator (Curate) on Aug 15, 2001 at 21:21 UTC |