Corset 4.0.29

There is a newer version of this package available.
See the version list below for details.
dotnet add package Corset --version 4.0.29                
NuGet\Install-Package Corset -Version 4.0.29                
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="Corset" Version="4.0.29" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Corset --version 4.0.29                
#r "nuget: Corset, 4.0.29"                
#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.
// Install Corset as a Cake Addin
#addin nuget:?package=Corset&version=4.0.29

// Install Corset as a Cake Tool
#tool nuget:?package=Corset&version=4.0.29                

Corset

.NET Publish

Corset is a library designed to simplify compression in .Net. By default it supports Deflate and GZip but can be expanded upon to support other types of compression.

Basic Usage

uses a library called Canister for registering itself in your ServiceCollection:

servicecollection.AddCanisterModules();

This line is required prior to using the extension methods for the first time. Once Canister is set up, you can call the extension methods provided:

string Data = "This is a bit of data that I want to compress";
string CompressedBase64String = Data.Compress();

The Compress extension method works on both strings and byte arrays. It will also allow you to specify which Encoding the string is using. By default it assumes a UTF8 encoding but this can be set as one of the parameters. The result from the Compress function will be either a Base64 string if it was called on a string or a byte array if you called the function on a byte array.

In order to Decompress the data, you simply call the Decompress extension method:

string CompressedData = "This is a bit of data that I want to compress".Compress();
string DecompressedData = CompressedData.Decompress();

Like the Compress extension, this method works on both strings and byte arrays. It allows you to specify which Encoding the string you want back should be in, if called on a string. By default it assumes a UTF8 encoding. The result from the Decompress function is either a string if called on a string, or a byte array if called on a byte array.

Adding Compression Types

The system loads the compressors at the beginning when Canister is initialized. In order to add your own compression type simply implement the ICompressor interface and pass the assembly it resides in to the Canister initialization line along with the Corset assembly. You may also wish to look at the CompressorBase class as it has some of the code needed already written and just requires you to write a Stream to do the actual compression.

Installation

The library is available via Nuget with the package name "Corset". To install it run the following command in the Package Manager Console:

Install-Package Corset

Build Process

In order to build the library you will require the following as a minimum:

  1. Visual Studio 2022

Other than that, just clone the project and you should be able to load the solution and build without too much effort.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.1 33 11/24/2024
5.0.0 38 11/22/2024
4.0.51 81 11/15/2024
4.0.50 88 11/11/2024
4.0.49 76 11/4/2024
4.0.48 73 10/29/2024
4.0.47 75 10/29/2024
4.0.46 86 10/14/2024
4.0.45 88 10/9/2024
4.0.44 128 8/22/2024
4.0.43 117 8/21/2024
4.0.42 54 8/1/2024
4.0.41 204 6/25/2024
4.0.40 103 6/17/2024
4.0.39 107 5/30/2024
4.0.38 135 5/6/2024
4.0.37 103 5/1/2024
4.0.36 100 5/1/2024
4.0.35 104 5/1/2024
4.0.34 116 4/29/2024
4.0.33 124 3/27/2024
4.0.32 102 3/14/2024
4.0.31 111 3/13/2024
4.0.30 119 3/6/2024
4.0.29 108 3/5/2024
4.0.28 109 2/26/2024
4.0.27 126 2/21/2024
4.0.26 120 2/19/2024
4.0.25 127 2/2/2024
4.0.24 112 1/29/2024
4.0.23 111 1/19/2024
4.0.22 186 12/11/2023
4.0.21 153 11/17/2023
4.0.20 100 11/16/2023
4.0.19 123 11/15/2023
4.0.18 136 11/7/2023
4.0.17 132 11/3/2023
4.0.16 147 10/31/2023
4.0.15 137 10/27/2023
4.0.14 146 9/18/2023
4.0.13 158 9/11/2023
4.0.12 151 9/5/2023
4.0.11 164 9/4/2023
4.0.10 187 8/31/2023
4.0.9 177 8/30/2023
4.0.8 166 8/29/2023
4.0.7 138 8/29/2023
4.0.6 164 8/8/2023
4.0.5 174 8/8/2023
4.0.4 155 8/4/2023
4.0.3 191 7/13/2023
4.0.2 176 7/12/2023
4.0.1 183 7/10/2023
3.0.4 531 1/11/2022
3.0.3 490 1/7/2021
3.0.2 503 9/13/2020
3.0.1 553 3/25/2020
3.0.0 598 12/23/2019
2.0.4 1,151 6/1/2018
2.0.3 1,049 5/22/2018
2.0.2 1,224 4/6/2018
2.0.0 1,074 1/2/2018
1.0.8 1,074 5/17/2017
1.0.7 1,068 3/22/2017
1.0.6 1,064 1/24/2017
1.0.5 1,075 12/9/2016
1.0.4 1,110 11/18/2016
1.0.3 1,063 11/18/2016
1.0.2 1,081 11/18/2016
1.0.1 1,063 11/18/2016