I am calculating MD5 sums for files on a unix distribution server and windows clients to check thay are the same. This works fine for gzip files, tar files, plain text but for .exe files the checksums differ.

# on 'doze.. # This is perl, v5.8.6 built for MSWin32-x86-multi-thread perl -le "use Digest::MD5 ('md5_base64'); print md5_base64(<>);" perl. +exe hoHYr/QOR7z7Pre69QdMOg D:\perl\bin>ftp tivprehub1 Connected to tivprehub1. <snip> 230 User ******* logged in. ftp> bin 200 Type set to I. ftp> put perl.exe 200 PORT command successful. 150 Opening data connection for perl.exe. 226 Transfer complete. 41033 bytes sent in 0.33 seconds (124.72 Kbytes/sec) ftp> bye 221 Goodbye. # *nix # This is perl, v5.8.0 built for aix-thread-multi nph>perl -le'use Digest::MD5 ("md5_base64"); print md5_base64(<>);' pe +rl.exe +QpV/tbZNRzK5aIPqc18tQ # now I gzip the exe at both ends... # 'doze perl -le "use Digest::MD5 ('md5_base64'); print md5_base64(<>);" perl. +exe.gz QinlhnAssDofoVV07khg1g # *nix nph>perl -le'use Digest::MD5 ("md5_base64"); print md5_base64(<>);' pe +rl.exe.gz QinlhnAssDofoVV07khg1g
Does anyone have a clue why this may be ? I have the workaround of gzipping the executables I am to compare then comparing these checksums but would rather not. I am imagining that little paperclip popping up 'looks like you are trying to open an executable ... '

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

In reply to md5 sum different on windows and unix for win.exe files !!? by Random_Walk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.