Skip to content

Commit

Permalink
A bug fix to the calculation of the adler32 hash when compressing dat…
Browse files Browse the repository at this point in the history
…a. Also added strong name signing as well.

Signed-off-by: AraHaan <[email protected]>
  • Loading branch information
AraHaan committed Dec 26, 2023
1 parent e904a3d commit b409a4d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Elskom.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

</Project>
Binary file added Elskom.snk
Binary file not shown.
4 changes: 2 additions & 2 deletions src/ZlibSharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<Import Project="../../Directory.Build.props" />

<PropertyGroup>
<Version>1.2.13.2</Version>
<Version>1.2.13.3</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageReleaseNotes>
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.
</PackageReleaseNotes>
<Description>
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.
Expand Down
2 changes: 1 addition & 1 deletion src/ZlibSharp/ZlibSharp/Internal/ZlibHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal static uint Compress(ReadOnlySpan<byte> source, Span<byte> dest, ZlibCo
}
}

adler32 = unchecked((uint)(MemoryZlib.ZlibGetAdler32(dest) & 0xFFFFFFFF));
adler32 = unchecked((uint)(MemoryZlib.ZlibGetAdler32(source) & 0xFFFFFFFF));
DeflateEnd(streamPtr);
return (uint)stream.total_out.Value;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b409a4d

Please sign in to comment.