Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.30.6",
"version": "1.0.2",
"commands": [
"dotnet-csharpier"
"csharpier"
],
"rollForward": false
}
Expand Down
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project>
<ItemGroup>
<PackageVersion Include="Bullseye" Version="5.0.0" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="Bullseye" Version="6.0.0" />
<PackageVersion Include="AwesomeAssertions" Version="9.0.0" />
<PackageVersion Include="Glob" Version="1.1.9" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Mono.Posix.NETStandard" Version="1.0.0" />
<PackageVersion Include="SimpleExec" Version="12.0.0" />
<PackageVersion Include="System.Buffers" Version="4.6.0" />
<PackageVersion Include="System.Memory" Version="4.6.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.0" />
<PackageVersion Include="xunit.SkippableFact" Version="1.5.23" />
<PackageVersion Include="ZstdSharp.Port" Version="0.8.4" />
<PackageVersion Include="ZstdSharp.Port" Version="0.8.5" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
</Project>
16 changes: 8 additions & 8 deletions build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Target(
Clean,
ForEach("**/bin", "**/obj"),
["**/bin", "**/obj"],
dir =>
{
IEnumerable<string> GetDirectories(string d)
Expand Down Expand Up @@ -44,14 +44,14 @@ void RemoveDirectory(string d)
() =>
{
Run("dotnet", "tool restore");
Run("dotnet", "csharpier --check .");
Run("dotnet", "csharpier check .");
}
);
Target(Restore, DependsOn(Format), () => Run("dotnet", "restore"));
Target(Restore, [Format], () => Run("dotnet", "restore"));

Target(
Build,
DependsOn(Restore),
[Restore],
() =>
{
Run("dotnet", "build src/SharpCompress/SharpCompress.csproj -c Release --no-restore");
Expand All @@ -60,8 +60,8 @@ void RemoveDirectory(string d)

Target(
Test,
DependsOn(Build),
ForEach("net8.0", "net48"),
[Build],
["net8.0", "net48"],
framework =>
{
IEnumerable<string> GetFiles(string d)
Expand All @@ -83,13 +83,13 @@ IEnumerable<string> GetFiles(string d)

Target(
Publish,
DependsOn(Test),
[Test],
() =>
{
Run("dotnet", "pack src/SharpCompress/SharpCompress.csproj -c Release -o artifacts/");
}
);

Target("default", DependsOn(Publish), () => Console.WriteLine("Done!"));
Target("default", [Publish], () => Console.WriteLine("Done!"));

await RunTargetsAndExitAsync(args);
5 changes: 1 addition & 4 deletions build/build.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bullseye" />
<PackageReference Include="Glob" />
<PackageReference Include="SimpleExec" />
<PackageReference Include="SimpleExec" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions build/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net8.0": {
"Bullseye": {
"type": "Direct",
"requested": "[5.0.0, )",
"resolved": "5.0.0",
"contentHash": "bqyt+m17ym+5aN45C5oZRAjuLDt8jKiCm/ys1XfymIXSkrTFwvI/QsbY3ucPSHDz7SF7uON7B57kXFv5H2k1ew=="
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "vgwwXfzs7jJrskWH7saHRMgPzziq/e86QZNWY1MnMxd7e+De7E7EX4K3C7yrvaK9y02SJoLxNxcLG/q5qUAghw=="
},
"Glob": {
"type": "Direct",
Expand Down
1 change: 0 additions & 1 deletion src/SharpCompress/Compressors/Deflate/ZlibConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
//
// -----------------------------------------------------------------------


namespace SharpCompress.Compressors.Deflate;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ internal static class FastEncoderStatics
// cache locality, fewer memory operations.
//


// Encoding information for literal and Length.
// The least 5 significant bits are the length
// and the rest is the code bits.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#region Using



#endregion

namespace SharpCompress.Compressors.PPMd.I1;
Expand Down
1 change: 0 additions & 1 deletion src/SharpCompress/Compressors/PPMd/I1/See2Context.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#region Using



#endregion

namespace SharpCompress.Compressors.PPMd.I1;
Expand Down
1 change: 0 additions & 1 deletion src/SharpCompress/Compressors/Rar/UnpackV1/Unpack50.cs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ private bool UnpReadBuf()
// WriteBorder=WrPtr;
// }


// unused
//x byte* ApplyFilter(byte *Data,uint DataSize,UnpackFilter *Flt)
// byte[] ApplyFilter(byte []Data, uint DataSize, UnpackFilter Flt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ internal static class PackDef
// CODE_ENDFILE, CODE_FILTER, CODE_FILTERDATA
// };


//enum FilterType {
// These values must not be changed, because we use them directly
// in RAR5 compression and decompression code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using size_t = System.UInt64;
#endif*/


namespace SharpCompress.Compressors.Rar.UnpackV2017;

internal partial class Unpack
Expand Down Expand Up @@ -69,7 +68,6 @@ private void RawPut4(uint32 Field, byte[] D, int offset)
//#endif
//}


//#if defined(LITTLE_ENDIAN) && defined(ALLOW_MISALIGNED)
//#define USE_MEM_BYTESWAP
//#endif
Expand All @@ -86,7 +84,6 @@ private void RawPut4(uint32 Field, byte[] D, int offset)
//#endif
//}


// Save integer to memory as big endian.
//inline void RawPutBE4(uint32 i,byte *mem)
//{
Expand All @@ -102,7 +99,6 @@ private void RawPut4(uint32 Field, byte[] D, int offset)
//#endif
//}


//inline uint32 ByteSwap32(uint32 i)
//{
//#ifdef _MSC_VER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using size_t = System.UInt64;
#endif*/


namespace SharpCompress.Compressors.Rar.UnpackV2017;

internal partial class Unpack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ private void Init(size_t WinSize, bool Solid)
// sharpcompress: don't need this, freshly allocated above
//memset(NewWindow,0,WinSize);


// If Window is not NULL, it means that window size has grown.
// In solid streams we need to copy data to a new window in such case.
// RAR archiving code does not allow it in solid streams now,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using size_t = System.UInt64;
#endif*/


namespace SharpCompress.Compressors.Rar.UnpackV2017;

internal partial class Unpack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ struct UnpackThreadData
};
#endif*/


//struct UnpackFilter
internal class UnpackFilter
{
Expand Down
54 changes: 27 additions & 27 deletions src/SharpCompress/SharpCompress.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>SharpCompress - Pure C# Decompression/Compression</AssemblyTitle>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>0.39.0</VersionPrefix>
<AssemblyVersion>0.39.0</AssemblyVersion>
<FileVersion>0.39.0</FileVersion>
<Authors>Adam Hathcock</Authors>
<TargetFrameworks>net48;net481;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<AssemblyName>SharpCompress</AssemblyName>
<AssemblyOriginatorKeyFile>../../SharpCompress.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PackageId>SharpCompress</PackageId>
<PackageTags>rar;unrar;zip;unzip;bzip2;gzip;tar;7zip;lzip;xz</PackageTags>
<PackageProjectUrl>https://github.com/adamhathcock/sharpcompress</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) 2025 Adam Hathcock</Copyright>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Description>SharpCompress is a compression library for NET Standard 2.0/NET 4.8/NET 4.8.1/NET 6.0/NET 8.0 that can unrar, decompress 7zip, decompress xz, zip/unzip, tar/untar lzip/unlzip, bzip2/unbzip2 and gzip/ungzip with forward-only reading and file random access APIs. Write support for zip/tar/bzip2/gzip is implemented.</Description>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PropertyGroup>
<AssemblyTitle>SharpCompress - Pure C# Decompression/Compression</AssemblyTitle>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>0.39.0</VersionPrefix>
<AssemblyVersion>0.39.0</AssemblyVersion>
<FileVersion>0.39.0</FileVersion>
<Authors>Adam Hathcock</Authors>
<TargetFrameworks>net48;net481;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<AssemblyName>SharpCompress</AssemblyName>
<AssemblyOriginatorKeyFile>../../SharpCompress.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PackageId>SharpCompress</PackageId>
<PackageTags>rar;unrar;zip;unzip;bzip2;gzip;tar;7zip;lzip;xz</PackageTags>
<PackageProjectUrl>https://github.com/adamhathcock/sharpcompress</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) 2025 Adam Hathcock</Copyright>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Description>SharpCompress is a compression library for NET Standard 2.0/NET 4.8/NET 4.8.1/NET 6.0/NET 8.0 that can unrar, decompress 7zip, decompress xz, zip/unzip, tar/untar lzip/unlzip, bzip2/unbzip2 and gzip/ungzip with forward-only reading and file random access APIs. Write support for zip/tar/bzip2/gzip is implemented.</Description>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageReadmeFile>README.md</PackageReadmeFile>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Buffers" />
<PackageReference Include="ZstdSharp.Port" />
<PackageReference Include="System.Buffers" />
<PackageReference Include="ZstdSharp.Port" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
Expand Down
36 changes: 18 additions & 18 deletions src/SharpCompress/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
},
"ZstdSharp.Port": {
"type": "Direct",
"requested": "[0.8.4, )",
"resolved": "0.8.4",
"contentHash": "eieSXq3kakCUXbgdxkKaRqWS6hF0KBJcqok9LlDCs60GOyrynLvPOcQ0pRw7shdPF7lh/VepJ9cP9n9HHc759g==",
"requested": "[0.8.5, )",
"resolved": "0.8.5",
"contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"System.Memory": "4.5.5",
Expand Down Expand Up @@ -106,9 +106,9 @@
},
"ZstdSharp.Port": {
"type": "Direct",
"requested": "[0.8.4, )",
"resolved": "0.8.4",
"contentHash": "eieSXq3kakCUXbgdxkKaRqWS6hF0KBJcqok9LlDCs60GOyrynLvPOcQ0pRw7shdPF7lh/VepJ9cP9n9HHc759g==",
"requested": "[0.8.5, )",
"resolved": "0.8.5",
"contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"System.Memory": "4.5.5",
Expand Down Expand Up @@ -227,9 +227,9 @@
},
"ZstdSharp.Port": {
"type": "Direct",
"requested": "[0.8.4, )",
"resolved": "0.8.4",
"contentHash": "eieSXq3kakCUXbgdxkKaRqWS6hF0KBJcqok9LlDCs60GOyrynLvPOcQ0pRw7shdPF7lh/VepJ9cP9n9HHc759g==",
"requested": "[0.8.5, )",
"resolved": "0.8.5",
"contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"System.Memory": "4.5.5",
Expand Down Expand Up @@ -289,9 +289,9 @@
},
"ZstdSharp.Port": {
"type": "Direct",
"requested": "[0.8.4, )",
"resolved": "0.8.4",
"contentHash": "eieSXq3kakCUXbgdxkKaRqWS6hF0KBJcqok9LlDCs60GOyrynLvPOcQ0pRw7shdPF7lh/VepJ9cP9n9HHc759g=="
"requested": "[0.8.5, )",
"resolved": "0.8.5",
"contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
Expand All @@ -307,9 +307,9 @@
"net8.0": {
"Microsoft.NET.ILLink.Tasks": {
"type": "Direct",
"requested": "[8.0.15, )",
"resolved": "8.0.15",
"contentHash": "s4eXlcRGyHeCgFUGQnhq0e/SCHBPp0jOHgMqZg3fQ2OCHJSm1aOUhI6RFWuVIcEb9ig2WgI2kWukk8wu72EbUQ=="
"requested": "[8.0.16, )",
"resolved": "8.0.16",
"contentHash": "0H1QaKpVibe++Zx6EYJQGhrpfz2bBPGiQ7Rpsmx8I3+oKv+ZRRIfVfmcj50KuZlhhRE6V02y5bUjP+V2oPM2ng=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
Expand All @@ -329,9 +329,9 @@
},
"ZstdSharp.Port": {
"type": "Direct",
"requested": "[0.8.4, )",
"resolved": "0.8.4",
"contentHash": "eieSXq3kakCUXbgdxkKaRqWS6hF0KBJcqok9LlDCs60GOyrynLvPOcQ0pRw7shdPF7lh/VepJ9cP9n9HHc759g=="
"requested": "[0.8.5, )",
"resolved": "0.8.5",
"contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
Expand Down
4 changes: 2 additions & 2 deletions tests/SharpCompress.Test/Rar/RarArchiveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ private void ReadRarPassword(string testArchive, string? password)

[Fact]
public void Rar_Multi_Archive_Encrypted() =>
Assert.Throws<InvalidFormatException>(
() => ArchiveFileReadPassword("Rar.EncryptedParts.part01.rar", "test")
Assert.Throws<InvalidFormatException>(() =>
ArchiveFileReadPassword("Rar.EncryptedParts.part01.rar", "test")
);

protected void ArchiveFileReadPassword(string archiveName, string password)
Expand Down
Loading