Home » Questions » Computers [ Ask a new question ]

Why is my command-line hash different from online MD5 hash results?

Why is my command-line hash different from online MD5 hash results?

On a Mac OS X v10.5 (Leopard) PowerPC, if I do:

Asked by: Guest | Views: 243
Total answers/comments: 2
Guest [Entry]

"When you echo from the command line, md5 is calculating the sum of 6 characters - h,e,l,l,o plus newline. The text you enter in a website doesn't have a newline.

Try doing

echo -n hello | md5

and it'll give you what you expect. The -n tells echo not to output a newline."
Guest [Entry]

"b1946ac92492d2347c6235b4d2611184 ist the md5 of just the string

hello

5d41402abc4b2a76b9719d911017c592 ist the md5 of

hello

CR+LF

CR+LF is the Windows newline."