DropBear.Codex.Serialization
2024.4.5
See the version list below for details.
dotnet add package DropBear.Codex.Serialization --version 2024.4.5
NuGet\Install-Package DropBear.Codex.Serialization -Version 2024.4.5
<PackageReference Include="DropBear.Codex.Serialization" Version="2024.4.5" />
paket add DropBear.Codex.Serialization --version 2024.4.5
#r "nuget: DropBear.Codex.Serialization, 2024.4.5"
// Install DropBear.Codex.Serialization as a Cake Addin #addin nuget:?package=DropBear.Codex.Serialization&version=2024.4.5 // Install DropBear.Codex.Serialization as a Cake Tool #tool nuget:?package=DropBear.Codex.Serialization&version=2024.4.5
DropBear.Codex.Serialization
Overview
DropBear.Codex.Serialization provides a robust and highly configurable serialization framework, supporting multiple serialization formats such as JSON and MessagePack. It integrates advanced features such as compression, encryption, and encoding to meet modern application needs for data handling and security.
Features
- Flexible Serialization & Deserialization: Supports multiple formats including JSON and MessagePack.
- Configurable Pipeline: Customize serialization processes with encryption, compression, and encoding through a fluent API.
- Encryption Support: Integrates RSA and AES encryption to ensure data security during serialization.
- Compression Options: Includes support for GZip and Deflate compression algorithms to optimize data size.
- Encoding Techniques: Supports Base64 and Hexadecimal encoding to enhance data interoperability.
- Stream Serialization: Facilitates serialization and deserialization directly from and to streams, improving performance for large data sets.
Getting Started
Setup
To utilize the serialization capabilities, you need to configure and build the serializer using the SerializationBuilder
. Here's how you can set it up in your application:
var builder = new SerializationBuilder()
.WithSerializer<JsonSerializer>() // Choose the serializer
.WithCompression<GZipCompressionProvider>() // Specify compression
.WithEncryption("path/to/publicKey", "path/to/privateKey") // Configure encryption
.WithEncoding<Base64EncodingProvider>(); // Set encoding
var serializer = builder.Build();
Registration in Dependency Injection (DI) You can easily integrate the serialization builder into a DI container to use throughout your application:
services.AddSingleton<ISerializer>(_ => new SerializationBuilder()
.WithSerializer<JsonSerializer>()
.WithCompression<GZipCompressionProvider>()
.WithEncryption("path/to/publicKey", "path/to/privateKey")
.WithEncoding<Base64EncodingProvider>()
.Build());
Usage Use the serializer instance created by the SerializationBuilder to serialize and deserialize data:
var myObject = new MyDataClass();
var serializedData = await serializer.SerializeAsync(myObject);
var deserializedObject = await serializer.DeserializeAsync<MyDataClass>(serializedData);
This setup ensures that the data is serialized, compressed, encrypted, and encoded seamlessly.
Contributing
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under GNU Lesser General Public License.
Development Status
Note: This library is relatively new and under active development. While it is being developed with robustness and best practices in mind, it may still be evolving.
We encourage you to test thoroughly and contribute if possible before using this library in a production environment. The API and features may change as feedback is received and improvements are made. We appreciate your understanding and contributions to making this library better!
Please use the following link to report any issues or to contribute: GitHub Issues.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- DropBear.Codex.AppLogger (>= 2024.4.10)
- DropBear.Codex.Core (>= 2024.4.5)
- K4os.Compression.LZ4 (>= 1.3.8)
- K4os.Compression.LZ4.Streams (>= 1.3.8)
- MemoryPack (>= 1.21.1)
- MessagePack (>= 2.5.140)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.0)
- System.Security.Cryptography.ProtectedData (>= 8.0.0)
- ZString (>= 2.6.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DropBear.Codex.Serialization:
Package | Downloads |
---|---|
DropBear.Codex.Files
Provides file management and storage capabilities for the DropBear.Codex ecosystem |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2024.11.5 | 53 | 11/12/2024 |
2024.9.44 | 101 | 9/20/2024 |
2024.9.43 | 125 | 9/16/2024 |
2024.9.42 | 104 | 9/16/2024 |
2024.9.32 | 105 | 9/13/2024 |
2024.9.25 | 113 | 9/11/2024 |
2024.9.1 | 108 | 9/8/2024 |
2024.8.54 | 109 | 9/6/2024 |
2024.8.36 | 105 | 9/2/2024 |
2024.7.1 | 77 | 7/24/2024 |
2024.4.14 | 171 | 4/23/2024 |
2024.4.13 | 124 | 4/23/2024 |
2024.4.12 | 107 | 4/23/2024 |
2024.4.10 | 108 | 4/23/2024 |
2024.4.9 | 100 | 4/22/2024 |
2024.4.8 | 110 | 4/22/2024 |
2024.4.7 | 98 | 4/22/2024 |
2024.4.6 | 120 | 4/20/2024 |
2024.4.5 | 104 | 4/20/2024 |
2024.4.4 | 85 | 4/20/2024 |
2024.4.3 | 104 | 4/19/2024 |
2024.3.15 | 119 | 4/1/2024 |
2024.3.13 | 80 | 3/30/2024 |
2024.3.12 | 97 | 3/30/2024 |
2024.3.11 | 96 | 3/30/2024 |
2024.3.9 | 111 | 3/30/2024 |
2024.3.8 | 91 | 3/30/2024 |
2024.3.5 | 182 | 3/29/2024 |
2024.3.4 | 107 | 3/28/2024 |
2024.3.3 | 120 | 3/21/2024 |
2024.3.2 | 102 | 3/16/2024 |
2024.3.1 | 124 | 3/11/2024 |
2024.2.11 | 119 | 2/28/2024 |
2024.2.9 | 122 | 2/26/2024 |
2024.2.8 | 125 | 2/25/2024 |