GNU bug report logs - #17997
md5sum adds a new line at the end of the input

Previous Next

Package: coreutils;

Reported by: xavier.richez <at> laposte.net

Date: Fri, 11 Jul 2014 15:39:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: xavier.richez <at> laposte.net
To: 17997 <at> debbugs.gnu.org
Subject: bug#17997: md5sum adds a new line at the end of the input
Date: Fri, 11 Jul 2014 10:48:30 +0200
[Message part 1 (text/plain, inline)]
Hello,

I implemented my own MD5 generator.
It provides the same results as all the online MD5 generators, like for instance http://onlinemd5.com/.

But it gives a different result than the GNU md5sum tool.
So I investigated this : it seems that md5sum adds a newline at the end of the input !

That is quite easy to test :
- go to http://onlinemd5.com/, type "test" as text input. The MD5 sum is 098f6bcd4621d373cade4e832627b4f6
- now type in a prompt : "echo test | md5sum". The MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249
- back to onlinemd5.com, type "test" and press enter to add a new line in the input. Now the MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249 !!

This behaviour was detected on RedHat Enterprise Linux 6.3 with GNU Coreutils 8.4.
I was able to reproduce it using the latest 8.22 version (fresh build) on the same machine, and on CentOS 5.10 with Coreutils 5.97.

Did someone know about this ?

Best regards,
Xavier Richez.
[Message part 2 (text/html, inline)]

This bug report was last modified 10 years and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.