comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not>
Subject: Re: GNAT.SHA256 produces result different from sha257sum on Linux
Date: Sat, 4 Nov 2023 16:09:58 +0100	[thread overview]
Message-ID: <ui5ms6$3d0f4$1@dont-email.me> (raw)
In-Reply-To: <87bkc9h9au.fsf@gmail.com>

On 2023-11-04 15:39, wvxvw wrote:
> 
> ❯ ./bin/test_sha --arg foo
> 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
> ❯ echo foo | sha256sum -
> b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c  -

I think the problem may be that echo adds an LF:

$ echo foo | hd
00000000  66 6f 6f 0a                                       |foo.|

Since sha256sum expects to work on arbitrary files, it would include the LF in 
its input.

-- 
Jeff Carter
"You can never forget too much about C++."
115

  reply	other threads:[~2023-11-04 15:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04 14:39 GNAT.SHA256 produces result different from sha257sum on Linux wvxvw
2023-11-04 15:09 ` Jeffrey R.Carter [this message]
2023-11-04 16:48   ` wvxvw
2023-11-04 17:53     ` Ben Bacarisse
2023-11-04 19:26       ` wvxvw
2023-11-04 16:49   ` Niklas Holsti
2023-11-04 17:39     ` Jeffrey R.Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox