diff --git a/Directory.Build.props b/Directory.Build.props index 6ac5a0d..98d7f6c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,8 @@ enable enable embedded + True + $(MSBuildThisFileDirectory)Elskom.snk diff --git a/Elskom.snk b/Elskom.snk new file mode 100644 index 0000000..19c0650 Binary files /dev/null and b/Elskom.snk differ diff --git a/src/ZlibSharp/Directory.Build.props b/src/ZlibSharp/Directory.Build.props index 4bea1a7..952e238 100644 --- a/src/ZlibSharp/Directory.Build.props +++ b/src/ZlibSharp/Directory.Build.props @@ -3,11 +3,11 @@ - 1.2.13.2 + 1.2.13.3 true true - A minor bug fix the the previous patch release that fixes the incorect default window bits values in the various MemoryZlib members that were changed/introduced in that update. + A bug fix to the calculation of the adler32 hash when compressing data. Also added strong name signing as well. A high performance .NET zlib wrapper that is span based and offers more functionality over System.IO.Compression by allowing more developer control over how the data is compressed and by avoiding .NET's streams entirely. diff --git a/src/ZlibSharp/ZlibSharp/Internal/ZlibHelper.cs b/src/ZlibSharp/ZlibSharp/Internal/ZlibHelper.cs index 72d90b5..d439be5 100644 --- a/src/ZlibSharp/ZlibSharp/Internal/ZlibHelper.cs +++ b/src/ZlibSharp/ZlibSharp/Internal/ZlibHelper.cs @@ -42,7 +42,7 @@ internal static uint Compress(ReadOnlySpan source, Span dest, ZlibCo } } - adler32 = unchecked((uint)(MemoryZlib.ZlibGetAdler32(dest) & 0xFFFFFFFF)); + adler32 = unchecked((uint)(MemoryZlib.ZlibGetAdler32(source) & 0xFFFFFFFF)); DeflateEnd(streamPtr); return (uint)stream.total_out.Value; } diff --git a/tests/Test.cs b/tests/Test.cs index 589fb11..ace677e 100644 --- a/tests/Test.cs +++ b/tests/Test.cs @@ -83,7 +83,7 @@ public void DecompressionToOverAllocatedBufferShouldHaveBytesWrittenEqualToSourc [Fact] public void ZlibSharpVersionWorks() - => _ = MemoryZlib.ZlibSharpVersion().Should().Be("1.2.13.2"); + => _ = MemoryZlib.ZlibSharpVersion().Should().Be("1.2.13.3"); [Fact] public void ZlibVersionWorks()