What are the differences between MD5 binary mode and text mode?

WoooHaaaa picture WoooHaaaa · Aug 1, 2013 · Viewed 9.3k times · Source

Here's my testing :

...$ md5sum -b roy.html 
f9283ca2833ff7ebb6781ab8d23a21aa *roy.html
...$ md5sum -t roy.html 
f9283ca2833ff7ebb6781ab8d23a21aa  roy.html

Is there any different between these two mode ?

Answer

Oli picture Oli · Aug 1, 2013

‘-b’ ‘--binary’

  • Treat each input file as binary, by reading it in binary mode and
    outputting a ‘*’ flag. This is the inverse of --text. On systems like GNU that do not distinguish between binary and text files, this
    option merely flags each input mode as binary: the MD5 checksum is
    unaffected. This option is the default on systems like MS-DOS that
    distinguish between binary and text files, except for reading
    standard input when standard input is a terminal.

‘-t’ ‘--text’

  • Treat each input file as text, by reading it in text mode and outputting a ‘ ’ flag. This is the inverse of --binary. This option is the default on systems like GNU that do not distinguish between binary and text files. On other systems, it is the default for reading standard input when standard input is a terminal. This mode is never defaulted to if --tag is used.