in reply to Re: md5 sum different on windows and unix for win.exe files !!?
in thread md5 sum different on windows and unix for win.exe files !!?

dmerphq++

Thank you so much, that was just what was needed ...

# 'doze perl -e "use Digest::MD5('md5_base64');local $/;open $f,'perl.exe'; bi +nmode $f; $dat=<$f>;print md5_base64($dat)" +QpV/tbZNRzK5aIPqc18tQ # *nix perl -le'use Digest::MD5 ("md5_base64"); local $/;open $f, "perl.exe"; + binmode $f; $dat=<$f>;print md5_base64($dat);' perl.exe +QpV/tbZNRzK5aIPqc18tQ # and the reason I was being lazy and using md5_base64(<FH>) perl -le'use Digest::MD5 ("md5_base64"); @array=qw(a b c); print md5_b +ase64(@array);' kAFQmDzST7DWlj99KOF/cg perl -le'use Digest::MD5 ("md5_base64"); @array=qw(a b c); $array=join + "",@array; print md5_base64($array);' kAFQmDzST7DWlj99KOF/cg # thought that worked, but then did this... perl -le'use Digest::MD5 ("md5_base64"); local $/;open $f, "perl.exe"; + $data=<$f>;print md5_base64($data);' perl.exe +QpV/tbZNRzK5aIPqc18tQ perl -le'use Digest::MD5 ("md5_base64"); local $/;open $f, "perl.exe"; + binmode $f; print md5_base64($f);' perl.exe MzTg3hOPoYjcGlfa8CHjeg

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

Replies are listed 'Best First'.
Re^3: md5 sum different on windows and unix for win.exe files !!?
by BrowserUk (Patriarch) on Apr 06, 2005 at 15:53 UTC

    You can do that a little more easily:

    perl -MDigest::MD5=md5_base64 -0777 -e"binmode STDIN; print md5_base64 + <STDIN>" <\bin\perl.exe

    Note: The '<' before the filename which may get obscured by the wrap.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco.
    Rule 1 has a caveat! -- Who broke the cabal?