![]() |
VOOZH | about |
dotnet add package ktsu.SerializationProviders.SystemTextJson --version 1.1.0
NuGet\Install-Package ktsu.SerializationProviders.SystemTextJson -Version 1.1.0
<PackageReference Include="ktsu.SerializationProviders.SystemTextJson" Version="1.1.0" />
<PackageVersion Include="ktsu.SerializationProviders.SystemTextJson" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="ktsu.SerializationProviders.SystemTextJson" />Project file
paket add ktsu.SerializationProviders.SystemTextJson --version 1.1.0
#r "nuget: ktsu.SerializationProviders.SystemTextJson, 1.1.0"
#:package ktsu.SerializationProviders.SystemTextJson@1.1.0
#addin nuget:?package=ktsu.SerializationProviders.SystemTextJson&version=1.1.0Install as a Cake Addin
#tool nuget:?package=ktsu.SerializationProviders.SystemTextJson&version=1.1.0Install as a Cake Tool
A comprehensive collection of provider implementations for the ktsu ecosystem. This library provides standardized implementations of interfaces defined in ktsu.Abstractions, enabling consistent patterns across serialization, hashing, compression, encryption, file system access, and obfuscation.
Implementations of ISerializationProvider for popular JSON libraries:
| Package | Description |
|---|---|
ktsu.SerializationProviders.NewtonsoftJson |
Newtonsoft.Json (Json.NET) provider |
ktsu.SerializationProviders.SystemTextJson |
System.Text.Json provider |
Implementations of IHashProvider for cryptographic and non-cryptographic hash algorithms:
| Package | Hash Length | Description |
|---|---|---|
ktsu.HashProviders.MD5 |
16 bytes | MD5 hash algorithm |
ktsu.HashProviders.SHA1 |
20 bytes | SHA-1 hash algorithm |
ktsu.HashProviders.SHA256 |
32 bytes | SHA-256 hash algorithm |
ktsu.HashProviders.SHA384 |
48 bytes | SHA-384 hash algorithm |
ktsu.HashProviders.SHA512 |
64 bytes | SHA-512 hash algorithm |
ktsu.HashProviders.FNV1_32 |
4 bytes | FNV-1 32-bit non-cryptographic hash |
ktsu.HashProviders.FNV1a_32 |
4 bytes | FNV-1a 32-bit non-cryptographic hash |
ktsu.HashProviders.FNV1_64 |
8 bytes | FNV-1 64-bit non-cryptographic hash |
ktsu.HashProviders.FNV1a_64 |
8 bytes | FNV-1a 64-bit non-cryptographic hash |
Implementations of ICompressionProvider:
| Package | Description |
|---|---|
ktsu.CompressionProviders.Gzip |
Gzip compression/decompression |
Implementations of IEncryptionProvider:
| Package | Description |
|---|---|
ktsu.EncryptionProviders.Aes |
AES symmetric encryption |
Implementations of IFileSystemProvider:
| Package | Description |
|---|---|
ktsu.FileSystemProviders.Native |
Native file system operations |
Implementations of IObfuscationProvider:
| Package | Description |
|---|---|
ktsu.ObfuscationProviders.Base64 |
Base64 encoding/decoding |
Install the specific provider packages you need:
# Serialization
dotnet add package ktsu.SerializationProviders.NewtonsoftJson
dotnet add package ktsu.SerializationProviders.SystemTextJson
# Hashing
dotnet add package ktsu.HashProviders.SHA256
dotnet add package ktsu.HashProviders.MD5
# ... other hash providers
# Compression
dotnet add package ktsu.CompressionProviders.Gzip
# Encryption
dotnet add package ktsu.EncryptionProviders.Aes
# File System
dotnet add package ktsu.FileSystemProviders.Native
# Obfuscation
dotnet add package ktsu.ObfuscationProviders.Base64
using ktsu.Abstractions;
using ktsu.SerializationProviders.SystemTextJson;
ISerializationProvider serializer = new SystemTextJson();
// Serialize
using var writer = new StringWriter();
if (serializer.TrySerialize(myObject, writer))
{
string json = writer.ToString();
}
// Deserialize
byte[] jsonBytes = Encoding.UTF8.GetBytes(jsonString);
var result = serializer.Deserialize<MyClass>(jsonBytes.AsSpan());
using ktsu.Abstractions;
using ktsu.HashProviders.SHA256;
using IHashProvider hasher = new SHA256();
byte[] data = Encoding.UTF8.GetBytes("Hello, World!");
Span<byte> hash = stackalloc byte[hasher.HashLengthBytes];
if (hasher.TryHash(data, hash))
{
string hashHex = Convert.ToHexString(hash);
}
// Hash from stream
using var stream = File.OpenRead("file.txt");
if (hasher.TryHash(stream, hash))
{
// hash contains the file hash
}
using ktsu.Abstractions;
using ktsu.CompressionProviders.Gzip;
ICompressionProvider compressor = new Gzip();
byte[] original = Encoding.UTF8.GetBytes("Data to compress");
// Compress
if (compressor.TryCompress(original, out byte[] compressed))
{
// Use compressed data
}
// Decompress
if (compressor.TryDecompress(compressed, out byte[] decompressed))
{
string text = Encoding.UTF8.GetString(decompressed);
}
using ktsu.Abstractions;
using ktsu.EncryptionProviders.Aes;
using IEncryptionProvider encryptor = new Aes();
byte[] key = new byte[32]; // 256-bit key
byte[] iv = new byte[16]; // 128-bit IV
RandomNumberGenerator.Fill(key);
RandomNumberGenerator.Fill(iv);
byte[] plaintext = Encoding.UTF8.GetBytes("Secret message");
// Encrypt
if (encryptor.TryEncrypt(plaintext, key, iv, out byte[] ciphertext))
{
// Store or transmit ciphertext
}
// Decrypt
if (encryptor.TryDecrypt(ciphertext, key, iv, out byte[] decrypted))
{
string message = Encoding.UTF8.GetString(decrypted);
}
All providers integrate seamlessly with Microsoft.Extensions.DependencyInjection:
using Microsoft.Extensions.DependencyInjection;
using ktsu.Abstractions;
var services = new ServiceCollection();
// Register specific providers
services.AddSingleton<ISerializationProvider, SystemTextJson>();
services.AddSingleton<IHashProvider, SHA256>();
services.AddSingleton<ICompressionProvider, Gzip>();
services.AddSingleton<IEncryptionProvider, Aes>();
services.AddSingleton<IFileSystemProvider, Native>();
services.AddSingleton<IObfuscationProvider, Base64>();
var provider = services.BuildServiceProvider();
// Resolve and use
var serializer = provider.GetRequiredService<ISerializationProvider>();
var hasher = provider.GetRequiredService<IHashProvider>();
ktsu.AbstractionsIDisposableAll providers follow consistent error handling patterns:
// Hash providers return false on failure
if (!hasher.TryHash(data, destination))
{
// Handle failure (buffer too small, disposed, etc.)
}
// Serialization returns false/default on failure
if (!serializer.TrySerialize(obj, writer))
{
// Handle serialization failure
}
var result = serializer.Deserialize<MyClass>(invalidData);
if (result == null)
{
// Handle deserialization failure
}
// Compression/Encryption use out parameters
if (!compressor.TryCompress(data, out byte[] compressed))
{
// Handle compression failure
}
Licensed under the MIT License. See LICENSE.md for details.
Contributions are welcome! Please feel free to submit issues and pull requests.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 129 | 2/19/2026 |
| 1.0.10-pre.1 | 72 | 2/17/2026 |
| 1.0.9 | 124 | 2/16/2026 |
| 1.0.9-pre.1 | 70 | 2/16/2026 |
| 1.0.8 | 120 | 2/14/2026 |
| 1.0.7 | 128 | 2/14/2026 |
| 1.0.5 | 123 | 2/13/2026 |
| 1.0.5-pre.7 | 72 | 2/6/2026 |
| 1.0.5-pre.6 | 76 | 2/5/2026 |
| 1.0.5-pre.5 | 80 | 2/3/2026 |
| 1.0.5-pre.4 | 87 | 2/1/2026 |
| 1.0.5-pre.3 | 81 | 1/31/2026 |
| 1.0.5-pre.2 | 71 | 1/31/2026 |
| 1.0.5-pre.1 | 77 | 1/31/2026 |
| 1.0.4 | 133 | 1/30/2026 |
| 1.0.3 | 123 | 1/29/2026 |
| 1.0.3-pre.4 | 80 | 1/24/2026 |
| 1.0.3-pre.3 | 184 | 11/24/2025 |
| 1.0.3-pre.2 | 154 | 11/23/2025 |
| 1.0.3-pre.1 | 158 | 11/23/2025 |
## v1.1.0 (minor)
Changes since v1.0.0:
- Add configuration providers for JSON, TOML, and YAML formats ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove legacy build scripts ([@matt-edmondson](https://github.com/matt-edmondson))
- Add compression, hashing, and obfuscation providers ([@matt-edmondson](https://github.com/matt-edmondson))
- Add .gitignore and project.yml for Serena configuration ([@matt-edmondson](https://github.com/matt-edmondson))
- Update docs and api compatibility files ([@matt-edmondson](https://github.com/matt-edmondson))
- Add project references and update AssemblyInfo for testing and source linking ([@matt-edmondson](https://github.com/matt-edmondson))
- Change project SDK from Microsoft.NET.Sdk to MSTest.Sdk ([@matt-edmondson](https://github.com/matt-edmondson))
- Update target framework to net10.0 and adjust assertions in tests ([@matt-edmondson](https://github.com/matt-edmondson))
- Update package versions in Directory.Packages.props ([@matt-edmondson](https://github.com/matt-edmondson))
- Add CLAUDE.md for project guidance and documentation ([@matt-edmondson](https://github.com/matt-edmondson))
- Add SHA384 and SHA512 hash providers, along with FNV1_32, FNV1a_32, FNV1_64, and FNV1a_64 implementations. Update Common.sln and add corresponding unit tests for all new providers. Enhance existing tests for dependency injection and serialization. Include necessary project files and suppressions for compatibility. ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove .runsettings file, update project references in Common.sln, and add new providers for Gzip, Aes, Base64, MD5, SHA1, and SHA256 with corresponding project files. Update package versions in Directory.Packages.props and global.json. Add unit tests for dependency injection and functionality verification. ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.10-pre.1 (prerelease)
Changes since v1.0.9:
- Sync .github\workflows\dotnet.yml ([@KtsuTools](https://github.com/KtsuTools))
## v1.0.9 (patch)
Changes since v1.0.8:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.8 (patch)
Changes since v1.0.7:
- Remove legacy build scripts ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.7 (patch)
Changes since v1.0.6:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.6 (patch)
Changes since v1.0.5:
- Add compression, hashing, and obfuscation providers ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.5 (patch)
Changes since v1.0.4:
- Add .gitignore and project.yml for Serena configuration ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.5-pre.7 (prerelease)
Changes since v1.0.5-pre.6:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.5-pre.6 (prerelease)
Changes since v1.0.5-pre.5:
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.5-pre.5 (prerelease)
Changes since v1.0.5-pre.4:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.5-pre.4 (prerelease)
Changes since v1.0.5-pre.3:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.5-pre.3 (prerelease)
Changes since v1.0.5-pre.2:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync COPYRIGHT.md ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.5-pre.2 (prerelease)
Changes since v1.0.5-pre.1:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.5-pre.1 (prerelease)
No significant changes detected since v1.0.5.
## v1.0.4 (patch)
Changes since v1.0.3:
- Remove .github\workflows\project.yml ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.3 (patch)
Changes since v1.0.2:
- Update docs and api compatibility files ([@matt-edmondson](https://github.com/matt-edmondson))
- Add project references and update AssemblyInfo for testing and source linking ([@matt-edmondson](https://github.com/matt-edmondson))
- Change project SDK from Microsoft.NET.Sdk to MSTest.Sdk ([@matt-edmondson](https://github.com/matt-edmondson))
- Update target framework to net10.0 and adjust assertions in tests ([@matt-edmondson](https://github.com/matt-edmondson))
- Update package versions in Directory.Packages.props ([@matt-edmondson](https://github.com/matt-edmondson))
- Add CLAUDE.md for project guidance and documentation ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.3-pre.4 (prerelease)
Changes since v1.0.3-pre.3:
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\update-sdks.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .gitignore ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.3-pre.3 (prerelease)
Changes since v1.0.3-pre.2:
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.3-pre.2 (prerelease)
Changes since v1.0.3-pre.1:
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.0.3-pre.1 (prerelease)
No significant changes detected since v1.0.3.
## v1.0.2 (patch)
Changes since v1.0.1:
- Add .runsettings file for coverage configuration, update GitHub Actions workflow to handle skipped releases, and enhance PSBuild script for coverage file handling. Update winget manifest script to detect NuGet packages and refine project type checks. ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.1 (patch)
Changes since v1.0.0:
- Add SHA384 and SHA512 hash providers, along with FNV1_32, FNV1a_32, FNV1_64, and FNV1a_64 implementations. Update Common.sln and add corresponding unit tests for all new providers. Enhance existing tests for dependency injection and serialization. Include necessary project files and suppressions for compatibility. ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove .runsettings file, update project references in Common.sln, and add new providers for Gzip, Aes, Base64, MD5, SHA1, and SHA256 with corresponding project files. Update package versions in Directory.Packages.props and global.json. Add unit tests for dependency injection and functionality verification. ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.1-pre.1 (prerelease)
No significant changes detected since v1.0.1.
## v1.0.0 (major)
- Add MD5HashProvider implementation and project files ([@matt-edmondson](https://github.com/matt-edmondson))
- Initial commit ([@matt-edmondson](https://github.com/matt-edmondson))