Corset 4.0.5
See the version list below for details.
dotnet add package Corset --version 4.0.5
NuGet\Install-Package Corset -Version 4.0.5
<PackageReference Include="Corset" Version="4.0.5" />
paket add Corset --version 4.0.5
#r "nuget: Corset, 4.0.5"
// Install Corset as a Cake Addin #addin nuget:?package=Corset&version=4.0.5 // Install Corset as a Cake Tool #tool nuget:?package=Corset&version=4.0.5
Corset
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:
- 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 | Versions 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. |
-
net6.0
- Canister.IoC (>= 5.1.5)
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.4 | 78 | 12/6/2024 |
5.0.3 | 83 | 11/27/2024 |
5.0.2 | 80 | 11/26/2024 |
5.0.1 | 83 | 11/24/2024 |
5.0.0 | 90 | 11/22/2024 |
4.0.51 | 92 | 11/15/2024 |
4.0.50 | 99 | 11/11/2024 |
4.0.49 | 82 | 11/4/2024 |
4.0.48 | 80 | 10/29/2024 |
4.0.47 | 84 | 10/29/2024 |
4.0.46 | 94 | 10/14/2024 |
4.0.45 | 94 | 10/9/2024 |
4.0.44 | 136 | 8/22/2024 |
4.0.43 | 123 | 8/21/2024 |
4.0.42 | 60 | 8/1/2024 |
4.0.41 | 217 | 6/25/2024 |
4.0.40 | 111 | 6/17/2024 |
4.0.39 | 116 | 5/30/2024 |
4.0.38 | 141 | 5/6/2024 |
4.0.37 | 107 | 5/1/2024 |
4.0.36 | 104 | 5/1/2024 |
4.0.35 | 108 | 5/1/2024 |
4.0.34 | 120 | 4/29/2024 |
4.0.33 | 128 | 3/27/2024 |
4.0.32 | 109 | 3/14/2024 |
4.0.31 | 116 | 3/13/2024 |
4.0.30 | 123 | 3/6/2024 |
4.0.29 | 112 | 3/5/2024 |
4.0.28 | 115 | 2/26/2024 |
4.0.27 | 130 | 2/21/2024 |
4.0.26 | 125 | 2/19/2024 |
4.0.25 | 131 | 2/2/2024 |
4.0.24 | 117 | 1/29/2024 |
4.0.23 | 115 | 1/19/2024 |
4.0.22 | 190 | 12/11/2023 |
4.0.21 | 157 | 11/17/2023 |
4.0.20 | 106 | 11/16/2023 |
4.0.19 | 128 | 11/15/2023 |
4.0.18 | 140 | 11/7/2023 |
4.0.17 | 137 | 11/3/2023 |
4.0.16 | 153 | 10/31/2023 |
4.0.15 | 142 | 10/27/2023 |
4.0.14 | 150 | 9/18/2023 |
4.0.13 | 162 | 9/11/2023 |
4.0.12 | 155 | 9/5/2023 |
4.0.11 | 169 | 9/4/2023 |
4.0.10 | 191 | 8/31/2023 |
4.0.9 | 181 | 8/30/2023 |
4.0.8 | 170 | 8/29/2023 |
4.0.7 | 142 | 8/29/2023 |
4.0.6 | 170 | 8/8/2023 |
4.0.5 | 179 | 8/8/2023 |
4.0.4 | 160 | 8/4/2023 |
4.0.3 | 196 | 7/13/2023 |
4.0.2 | 181 | 7/12/2023 |
4.0.1 | 187 | 7/10/2023 |
3.0.4 | 535 | 1/11/2022 |
3.0.3 | 494 | 1/7/2021 |
3.0.2 | 507 | 9/13/2020 |
3.0.1 | 558 | 3/25/2020 |
3.0.0 | 602 | 12/23/2019 |
2.0.4 | 1,155 | 6/1/2018 |
2.0.3 | 1,053 | 5/22/2018 |
2.0.2 | 1,228 | 4/6/2018 |
2.0.0 | 1,078 | 1/2/2018 |
1.0.8 | 1,078 | 5/17/2017 |
1.0.7 | 1,073 | 3/22/2017 |
1.0.6 | 1,069 | 1/24/2017 |
1.0.5 | 1,080 | 12/9/2016 |
1.0.4 | 1,114 | 11/18/2016 |
1.0.3 | 1,069 | 11/18/2016 |
1.0.2 | 1,085 | 11/18/2016 |
1.0.1 | 1,068 | 11/18/2016 |