Corset 4.0.33

dotnet add package Corset --version 4.0.33
NuGet\Install-Package Corset -Version 4.0.33
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.33" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Corset --version 4.0.33
#r "nuget: Corset, 4.0.33"
#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.33

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

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
4.0.33 87 3/27/2024
4.0.32 71 3/14/2024
4.0.31 80 3/13/2024
4.0.30 89 3/6/2024
4.0.29 77 3/5/2024
4.0.28 81 2/26/2024
4.0.27 99 2/21/2024
4.0.26 91 2/19/2024
4.0.25 94 2/2/2024
4.0.24 79 1/29/2024
4.0.23 84 1/19/2024
4.0.22 159 12/11/2023
4.0.21 128 11/17/2023
4.0.20 73 11/16/2023
4.0.19 100 11/15/2023
4.0.18 108 11/7/2023
4.0.17 108 11/3/2023
4.0.16 120 10/31/2023
4.0.15 113 10/27/2023
4.0.14 119 9/18/2023
4.0.13 134 9/11/2023
4.0.12 125 9/5/2023
4.0.11 136 9/4/2023
4.0.10 156 8/31/2023
4.0.9 150 8/30/2023
4.0.8 138 8/29/2023
4.0.7 114 8/29/2023
4.0.6 139 8/8/2023
4.0.5 150 8/8/2023
4.0.4 131 8/4/2023
4.0.3 164 7/13/2023
4.0.2 148 7/12/2023
4.0.1 157 7/10/2023
3.0.4 505 1/11/2022
3.0.3 466 1/7/2021
3.0.2 475 9/13/2020
3.0.1 528 3/25/2020
3.0.0 567 12/23/2019
2.0.4 1,125 6/1/2018
2.0.3 1,019 5/22/2018
2.0.2 1,197 4/6/2018
2.0.0 1,049 1/2/2018
1.0.8 1,049 5/17/2017
1.0.7 1,040 3/22/2017
1.0.6 1,035 1/24/2017
1.0.5 1,045 12/9/2016
1.0.4 1,086 11/18/2016
1.0.3 1,039 11/18/2016
1.0.2 1,056 11/18/2016
1.0.1 1,040 11/18/2016