SharpCompress 0.39.0

Prefix Reserved
dotnet add package SharpCompress --version 0.39.0
                    
NuGet\Install-Package SharpCompress -Version 0.39.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpCompress" Version="0.39.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpCompress" Version="0.39.0" />
                    
Directory.Packages.props
<PackageReference Include="SharpCompress" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SharpCompress --version 0.39.0
                    
#r "nuget: SharpCompress, 0.39.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SharpCompress&version=0.39.0
                    
Install SharpCompress as a Cake Addin
#tool nuget:?package=SharpCompress&version=0.39.0
                    
Install SharpCompress as a Cake Tool

SharpCompress

SharpCompress is a compression library in pure C# for .NET Framework 4.62, .NET Standard 2.1, .NET 6.0 and NET 8.0 that can unrar, un7zip, unzip, untar unbzip2, ungzip, unlzip with forward-only reading and file random access APIs. Write support for zip/tar/bzip2/gzip/lzip are implemented.

The major feature is support for non-seekable streams so large files can be processed on the fly (i.e. download stream).

GitHub Actions Build - SharpCompress Static Badge

Need Help?

Post Issues on Github!

Check the Supported Formats and Basic Usage.

In general, I recommend GZip (Deflate)/BZip2 (BZip)/LZip (LZMA) as the simplicity of the formats lend to better long term archival as well as the streamability. Tar is often used in conjunction for multiple files in a single archive (e.g. .tar.gz)

Zip is okay, but it's a very hap-hazard format and the variation in headers and implementations makes it hard to get correct. Uses Deflate by default but supports a lot of compression methods.

RAR is not recommended as it's a propriatory format and the compression is closed source. Use Tar/LZip for LZMA

7Zip and XZ both are overly complicated. 7Zip does not support streamable formats. XZ has known holes explained here: (http://www.nongnu.org/lzip/xz_inadequate.html) Use Tar/LZip for LZMA compression instead.

A Simple Request

Hi everyone. I hope you're using SharpCompress and finding it useful. Please give me feedback on what you'd like to see changed especially as far as usability goes. New feature suggestions are always welcome as well. I would also like to know what projects SharpCompress is being used in. I like seeing how it is used to give me ideas for future versions. Thanks!

Please do not email me directly to ask for help. If you think there is a real issue, please report it here.

Want to contribute?

I'm always looking for help or ideas. Please submit code or email with ideas. Unfortunately, just letting me know you'd like to help is not enough because I really have no overall plan of what needs to be done. I'll definitely accept code submissions and add you as a member of the project!

TODOs (always lots)

  • RAR 5 decryption crc check support
  • 7Zip writing
  • Zip64 (Need writing and extend Reading)
  • Multi-volume Zip support.

Version Log

Version 0.18

Version 0.17.1

Version 0.17.0

Version 0.16.2

Version 0.16.1

Version 0.16.0

Version 0.15.2

  • Fix invalid headers - fixes an issue creating large-ish zip archives that was introduced with zip64 reading.

Version 0.15.1

Version 0.15.0

Version 0.14.1

Version 0.14.0

Version 0.13.1

Version 0.13.0

  • Breaking change: Big refactor of Options on API.
  • 7Zip supports Deflate

Version 0.12.4

Version 0.12.3

Version 0.12.2

  • Support Profile 259 again

Version 0.12.1

  • Support Silverlight 5

Version 0.12.0

  • .NET Core RTM!
  • Bug fix for Tar long paths

Version 0.11.6

  • Bug fix for global header in Tar
  • Writers now have a leaveOpen bool overload. They won't close streams if not-requested to.

Version 0.11.5

  • Bug fix in Skip method

Version 0.11.4

  • SharpCompress is now endian neutral (matters for Mono platforms)
  • Fix for Inflate (need to change implementation)
  • Fixes for RAR detection

Version 0.11.1

  • Added Cancel on IReader
  • Removed .NET 2.0 support and LinqBridge dependency

Version 0.11

  • Been over a year, contains mainly fixes from contributors!
  • Possible breaking change: ArchiveEncoding is UTF8 by default now.
  • TAR supports writing long names using longlink
  • RAR Protect Header added

Version 0.10.3

  • Finally fixed Disposal issue when creating a new archive with the Archive API

Version 0.10.2

  • Fixed Rar Header reading for invalid extended time headers.
  • Windows Store assembly is now strong named
  • Known issues with Long Tar names being worked on
  • Updated to VS2013
  • Portable targets SL5 and Windows Phone 8 (up from SL4 and WP7)

Version 0.10.1

  • Fixed 7Zip extraction performance problem

Version 0.10:

  • Added support for RAR Decryption (thanks to https://github.com/hrasyid)
  • Embedded some BouncyCastle crypto classes to allow RAR Decryption and Winzip AES Decryption in Portable and Windows Store DLLs
  • Built in Release (I think)

XZ implementation based on: https://github.com/sambott/XZ.NET by @sambott

XZ BCJ filters support contributed by Louis-Michel Bergeron, on behalf of aDolus Technology Inc. - 2022

7Zip implementation based on: https://code.google.com/p/managed-lzma/

LICENSE Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (308)

Showing the top 5 NuGet packages that depend on SharpCompress:

Package Downloads
MongoDB.Driver.Core

Core Component of the Official MongoDB .NET Driver.

MongoDB.Driver

Official .NET driver for MongoDB.

Ductus.FluentDocker

Library to manage docker-machine, docker-compose, and docker containers for windows / mac or native linux using netcore or full framework.

squirrel.windows

An installation and update framework for Windows applications

MongoDB.Driver.Core.signed

(Unofficial) Signed Core Component of the MongoDB .NET Driver. The containing assembly was generated by signing the officially published MongoDB.Driver.Core.dll.

GitHub repositories (145)

Showing the top 20 popular GitHub repositories that depend on SharpCompress:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
QL-Win/QuickLook
Bring macOS “Quick Look” feature to Windows
ppy/osu
rhythm is just a *click* away!
duplicati/duplicati
Store securely encrypted backups in the cloud!
babalae/better-genshin-impact
📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 - UI Automation Testing Tools For Genshin Impact
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
ldqk/Masuit.Tools
全龄段友好的C#万能工具库,码数吐司库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展、Excel导出等常用封装。诸多功能集一身,代码量不到2MB!
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
AssetRipper/AssetRipper
GUI Application to work with engine assets, asset bundles, and serialized files
HearthSim/Hearthstone-Deck-Tracker
A deck tracker and deck manager for Hearthstone on Windows
MediaBrowser/Emby
Emby Server is a personal media server with apps on just about every device.
Ombi-app/Ombi
Want a Movie or TV Show on Plex/Emby/Jellyfin? Use Ombi!
fluentassertions/fluentassertions
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET Core 2.1, .NET Core 3.0, .NET 6, .NET Standard 2.0 and 2.1. Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3.
SciSharp/TensorFlow.NET
.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
mongodb/mongo-csharp-driver
The Official C# .NET Driver for MongoDB
nodatime/nodatime
A better date and time API for .NET
stakira/OpenUtau
Open singing synthesis platform / Open source UTAU successor
ArcadeRenegade/SidebarDiagnostics
A simple sidebar for Windows desktop that displays hardware diagnostic information.
TASEmulators/BizHawk
BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
Version Downloads Last updated
0.39.0 361,318 1/16/2025
0.38.0 946,702 9/2/2024
0.37.2 965,106 4/27/2024
0.36.0 1,237,816 1/15/2024
0.35.0 161,894 12/18/2023
0.34.2 832,387 11/15/2023
0.34.1 454,409 10/2/2023
0.34.0 165,001 9/18/2023
0.33.0 1,745,980 3/21/2023
0.32.2 2,676,531 7/29/2022
0.32.1 515,671 6/20/2022
0.32.0 43,567 6/13/2022
0.31.0 2,224,643 3/30/2022
0.30.1 102,809,511 11/22/2021
0.30.0 3,346,669 10/2/2021
0.29.0 4,916,453 9/12/2021
0.28.3 1,060,119 6/4/2021 0.28.3 has at least one vulnerability with moderate severity.
0.28.2 541,875 4/25/2021 0.28.2 has at least one vulnerability with moderate severity.
0.28.1 701,272 2/18/2021 0.28.1 has at least one vulnerability with moderate severity.
0.28.0 21,479 2/14/2021 0.28.0 has at least one vulnerability with moderate severity.
0.27.1 185,177 1/13/2021 0.27.1 has at least one vulnerability with moderate severity.
0.27.0 29,971 1/11/2021 0.27.0 has at least one vulnerability with moderate severity.
0.26.0 1,232,312 7/26/2020 0.26.0 has at least one vulnerability with moderate severity.
0.25.1 434,668 5/22/2020 0.25.1 has at least one vulnerability with moderate severity.
0.25.0 658,719 4/3/2020 0.25.0 has at least one vulnerability with moderate severity.
0.24.0 2,563,215 8/20/2019 0.24.0 has at least one vulnerability with moderate severity.
0.23.0 88,759,830 2/27/2019 0.23.0 has at least one vulnerability with moderate severity.
0.22.0 926,816 7/9/2018 0.22.0 has at least one vulnerability with moderate severity.
0.21.1 78,974 5/15/2018 0.21.1 has at least one vulnerability with moderate severity.
0.21.0 32,158 5/9/2018 0.21.0 has at least one vulnerability with moderate severity.
0.20.0 144,625 3/24/2018 0.20.0 has at least one vulnerability with moderate severity.
0.19.2 129,910 12/16/2017 0.19.2 has at least one vulnerability with moderate severity.
0.19.1 6,312 12/15/2017 0.19.1 has at least one vulnerability with moderate severity.
0.19.0 9,080 12/12/2017 0.19.0 has at least one vulnerability with moderate severity.
0.18.2 513,886 9/22/2017 0.18.2 has at least one vulnerability with moderate severity.
0.18.1 47,765 8/17/2017 0.18.1 has at least one vulnerability with moderate severity.
0.18.0 42,277 7/19/2017 0.18.0 has at least one vulnerability with moderate severity.
0.17.1 1,398,387 6/9/2017 0.17.1 has at least one vulnerability with moderate severity.
0.17.0 15,117 6/1/2017 0.17.0 has at least one vulnerability with moderate severity.
0.16.2 9,934 5/31/2017 0.16.2 has at least one vulnerability with moderate severity.
0.16.1 44,636 5/23/2017 0.16.1 has at least one vulnerability with moderate severity.
0.16.0 6,430 5/22/2017 0.16.0 has at least one vulnerability with moderate severity.
0.15.2 389,361 3/9/2017 0.15.2 has at least one vulnerability with moderate severity.
0.15.1 103,940 1/26/2017 0.15.1 has at least one vulnerability with moderate severity.
0.15.0 6,669 1/24/2017 0.15.0 has at least one vulnerability with moderate severity.
0.14.1 35,713 11/30/2016 0.14.1 has at least one vulnerability with moderate severity.
0.14.0 42,949 10/14/2016 0.14.0 has at least one vulnerability with moderate severity.
0.13.1 18,236 10/3/2016 0.13.1 has at least one vulnerability with moderate severity.
0.13.0 7,005 9/29/2016 0.13.0 has at least one vulnerability with moderate severity.
0.12.4 35,415 8/12/2016 0.12.4 has at least one vulnerability with moderate severity.
0.12.3 26,343 7/22/2016 0.12.3 has at least one vulnerability with moderate severity.
0.12.2 4,579 7/18/2016 0.12.2 has at least one vulnerability with moderate severity.
0.12.1 4,874 7/13/2016 0.12.1 has at least one vulnerability with moderate severity.
0.12.0 4,690 7/13/2016 0.12.0 has at least one vulnerability with moderate severity.
0.11.6 323,303 4/7/2016 0.11.6 has at least one vulnerability with moderate severity.
0.11.5 127,591 2/14/2016 0.11.5 has at least one vulnerability with moderate severity.
0.11.4 8,746 2/7/2016 0.11.4 has at least one vulnerability with moderate severity.
0.11.3 14,736 12/28/2015 0.11.3 has at least one vulnerability with moderate severity.
0.11.2 34,313 12/1/2015 0.11.2 has at least one vulnerability with moderate severity.
0.11.1 49,468 7/27/2015 0.11.1 has at least one vulnerability with moderate severity.
0.11.0 6,432 6/12/2015 0.11.0 has at least one vulnerability with moderate severity.
0.10.3 54,560 12/15/2013 0.10.3 has at least one vulnerability with moderate severity.
0.10.2 126,725 11/23/2013 0.10.2 has at least one vulnerability with moderate severity.
0.10.1.3 34,485 8/14/2013 0.10.1.3 has at least one vulnerability with moderate severity.
0.10.1.1 4,365 8/13/2013 0.10.1.1 has at least one vulnerability with moderate severity.
0.10.1 4,601 8/11/2013 0.10.1 has at least one vulnerability with moderate severity.
0.10.0 5,381 7/27/2013 0.10.0 has at least one vulnerability with moderate severity.
0.9.0 8,722 5/4/2013 0.9.0 has at least one vulnerability with moderate severity.
0.8.2 18,418 12/11/2012 0.8.2 has at least one vulnerability with moderate severity.
0.8.1 8,314 5/15/2012 0.8.1 has at least one vulnerability with moderate severity.
0.8.0 15,505 2/27/2012 0.8.0 has at least one vulnerability with moderate severity.
0.7.0 5,064 11/16/2011 0.7.0 has at least one vulnerability with moderate severity.
0.6.0 4,704 9/22/2011 0.6.0 has at least one vulnerability with moderate severity.
0.5.0 4,623 7/6/2011 0.5.0 has at least one vulnerability with moderate severity.
0.4.0 4,613 6/22/2011 0.4.0 has at least one vulnerability with moderate severity.
0.3.0 4,535 5/27/2011 0.3.0 has at least one vulnerability with moderate severity.
0.2.0 22,726 5/12/2011 0.2.0 has at least one vulnerability with moderate severity.