From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: GNAT.SHA256 produces result different from sha257sum on Linux Date: Sat, 4 Nov 2023 16:09:58 +0100 Organization: A noiseless patient Spider Message-ID: References: <87bkc9h9au.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 4 Nov 2023 15:09:58 -0000 (UTC) Injection-Info: dont-email.me; posting-host="f17349dfb81b20de3803c6a532a5ed26"; logging-data="3572196"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lUeO9qGEjqQb7ZUn9ZMb9ZjFVJXrfp0s=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Cu8iuwx9bJRdq+tLQhI6gtC9jsM= Content-Language: en-US In-Reply-To: <87bkc9h9au.fsf@gmail.com> Xref: news.eternal-september.org comp.lang.ada:65837 List-Id: 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