go ahead... be a heretic | |
PerlMonks |
Re: SHA1 calculations using Digest::SHA1 do not agreeby NetWallah (Canon) |
on Nov 17, 2015 at 18:33 UTC ( [id://1147944]=note: print w/replies, xml ) | Need Help?? |
By default, the hexdigest will read the file in "OS Compatible" mode (as opposed to "portable" mode). This is made clear in the "--help" option of the "shasum" command, which is packaged with Digest::SHA1. In my tests on Windows7, the shasum command with the "-p" option produced the same results as the default call to the hexdigest() method. The "fciv" command, apparently reads the file in "binary" mode, which is also the default for the "shasum" command. In order to be compatible, you will need to add "binmode $filehandle;" prior to the addfile() call, as Corion(++) has independently suggested above. I have tested this, and it works. “The sources of quotes found on the internet are not always reliable.” — Abraham Lincoln.3; cf.
In Section
Seekers of Perl Wisdom
|
|