From 5f6012b4b1227a3aa8b0ca142d0fdb3b7bbe601c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:27:41 +0000 Subject: [PATCH 1/2] Initial plan From c98ef79eec39c4a1c636d0481ede2c8e40cfc82d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:50:35 +0000 Subject: [PATCH 2/2] Add AppendingEmptyHasNoEffect test to NonCryptoHashTestDriver Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> --- .../tests/NonCryptoHashTestDriver.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs b/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs index 92b0567427fe11..71eed3a8b16e9d 100644 --- a/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs +++ b/src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs @@ -309,6 +309,22 @@ public void Clone_ProducesSameSequence() } } + [Fact] + public void AppendingEmptyHasNoEffect() + { + NonCryptographicHashAlgorithm reference = CreateInstance(); + reference.Append(new byte[] { 1, 2, 3 }); + byte[] expected = reference.GetCurrentHash(); + + NonCryptographicHashAlgorithm hash = CreateInstance(); + hash.Append(ReadOnlySpan.Empty); + hash.Append(new byte[] { 1, 2, 3 }); + hash.Append(ReadOnlySpan.Empty); + byte[] actual = hash.GetCurrentHash(); + + Assert.Equal(expected, actual); + } + private void VerifyEmptyResult(ReadOnlySpan result) { if (!result.SequenceEqual(_emptyHash))