Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Output:50bd187a208112091b035c62209baf9742c243bduse Digest::SHA1; $sha1 = Digest::SHA1->new; $fhIN = $ARGV[0]; open(IN,$fhIN) || die "\ncan open file for input"; binmode IN; $sha1->addfile(IN); $digest = $sha1->hexdigest; print "$digest\n";
Output: 7ba6487fefcc4467b21deccac79b38d7d3b69bf2sub generateDigest{ my ($file) = @_; my $sha1 = Digest::SHA1->new; open(FILE, $file) || die; binmode FILE; $sha1->addfile(*FILE); close(FILE); my $digest = $sha1->hexdigest; warn "$digest"; return $digest; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Digest::Sha1 differences
by moritz (Cardinal) on May 19, 2010 at 13:25 UTC | |
by almut (Canon) on May 19, 2010 at 14:34 UTC | |
by Anonymous Monk on May 24, 2010 at 12:33 UTC | |
by Anonymous Monk on May 19, 2010 at 13:34 UTC | |
by moritz (Cardinal) on May 19, 2010 at 13:49 UTC |