MS-DOSへのファイル転送をテストしていて、確認のためのツールを探していたところ、ヤマハさんmd5のコマンドを提供していました。
早速ダウンロードして試してみたところ、なんだかおかしな値が返ります。
Windows 7で32Bit版のEXEを試しました。
C:\>md5sum yyy
571c3b2b2d3e0442b33c352acf7397d0 yyy
MS-DOS版(16ビット)も同じ値です。
ソースで提供されているプログラムをFreeBSD/i386でビルドして試してみました
% ./md5sum yyy
ad5e4192180b69500b060bb870f55d51 yyy
FreeBSDのコマンドでも試しました。
% md5 yyy
MD5 (yyy) = ad5e4192180b69500b060bb870f55d51
Windows 7標準のツールでも確認してみました。
C:\>certutil -hashfile yyy MD5
MD5 ハッシュ (ファイル yyy):
ad 5e 41 92 18 0b 69 50 0b 06 0b b8 70 f5 5d 51
CertUtil: -hashfile コマンドは正常に完了しました。
ソースを見てみたところ、MS-DOS,Windowsの場合-bオプションが必要でした。
提供されているソースコードはopen-watcom-v2でもコンパイルできexeが作れました。
毎回オプションを指定するのが面倒なので、デフォルトを代えてみました。