![]() |
VOOZH | about |
dotnet add package Gapotchenko.FX.Data.Encoding.Base16 --version 2026.7.2
NuGet\Install-Package Gapotchenko.FX.Data.Encoding.Base16 -Version 2026.7.2
<PackageReference Include="Gapotchenko.FX.Data.Encoding.Base16" Version="2026.7.2" />
<PackageVersion Include="Gapotchenko.FX.Data.Encoding.Base16" Version="2026.7.2" />Directory.Packages.props
<PackageReference Include="Gapotchenko.FX.Data.Encoding.Base16" />Project file
paket add Gapotchenko.FX.Data.Encoding.Base16 --version 2026.7.2
#r "nuget: Gapotchenko.FX.Data.Encoding.Base16, 2026.7.2"
#:package Gapotchenko.FX.Data.Encoding.Base16@2026.7.2
#addin nuget:?package=Gapotchenko.FX.Data.Encoding.Base16&version=2026.7.2Install as a Cake Addin
#tool nuget:?package=Gapotchenko.FX.Data.Encoding.Base16&version=2026.7.2Install as a Cake Tool
The module provides the implementation of binary-to-text encoding algorithms belonging to the Base16 family.
Use the following code to get the textual representation of the specified data in Base16 encoding:
using Gapotchenko.FX.Data.Encoding;
var encodedText = Base16.GetString(data);
To get the data back from the textual representation, use the following method:
var decodedData = Base16.GetBytes(encodedText);
Base16 encoding classes provide a set of convenient static methods that represent the most commonly used operations.
For a more general and full use, however, the classes implement ITextDataEncoding interface which can be accessed via the Instance property of the corresponding encoding class.
If you need to encode the data iteratively then the following approach becomes handy:
var encoding = Base16.Instance;
// Create a streaming encoder that iteratively encodes the data and
// writes the encoded text to the specified text writer.
var stream = encoding.CreateEncoder(textWriter);
// Iteratively stream the data to encode.
stream.Write(...); // block 1
// ...
stream.Write(...); // block N
// Flush the data to the underlying text writer.
stream.Flush();
The same approach is valid for the decoding operation which is the opposite of the encoding:
var encoding = Base16.Instance;
// Create a streaming decoder that iteratively reads the encoded text
// from the specified text reader and decodes the data on the fly.
var stream = encoding.CreateDecoder(textReader);
// Iteratively stream the decoded data.
stream.Read(...); // block 1
// ...
stream.Read(...); // block N
The streaming encoder and decoder can be used to iteratively transcode the data from one encoding to another.
Base16 family of binary-to-text data encodings consists of the following algorithms with predefined parameters:
| Algorithm | Gapotchenko.FX Implementation | Alphabet | Case-Sensitive | Data Encoding Efficiency* |
|---|---|---|---|---|
| Base16 | Base16 |
0123456789ABCDEF | No | 0.5 |
* Data encoding efficiency is the ratio between the amount of original data and its encoded representation.
Once in a while, you may encounter a custom Base16 algorithm that is neither widely known nor characterized. In that case, you can instantiate a custom data encoding algorithm with the desired parameters by hand. For example:
var encoding = new CustomBase16("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠ");
If you want to formalize the custom algorithm even further, you may opt in to create a separate class for it with a convenient accessor property:
/// <summary>
/// Defines a custom Base16 data encoding algorithm.
/// </summary>
sealed class FooBase16 : CustomBase16
{
FooBase16() :
base("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠ")
{
}
public static FooBase16 Instance { get; } = new();
}
That will allow you to use the algorithm effortlessly from several places in the codebase later:
var encodedText = FooBase16.Instance.GetString(...);
Gapotchenko.FX.Data.Encoding.Base16Let's continue with a look at some other modules provided by Gapotchenko.FX:
Or look at the full list of modules.
| 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 was computed. 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 was computed. 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 | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. 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. |
Showing the top 1 NuGet packages that depend on Gapotchenko.FX.Data.Encoding.Base16:
| Package | Downloads |
|---|---|
|
Gapotchenko.Shields.Microsoft.Wsl.Deployment
Locates setup instances of Windows Subsystem for Linux (WSL). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.7.2 | 110 | 5/16/2026 |
| 2026.6.2 | 136 | 3/29/2026 |
| 2026.5.3 | 127 | 2/24/2026 |
| 2026.4.2 | 137 | 2/4/2026 |
| 2026.3.5 | 129 | 1/29/2026 |
| 2026.2.2 | 146 | 1/25/2026 |
| 2026.1.5 | 143 | 1/13/2026 |
| 2025.1.45 | 245 | 12/25/2025 |
| 2025.1.27-beta | 209 | 10/8/2025 |
| 2025.1.26-beta | 265 | 8/30/2025 |
| 2025.1.25-beta | 932 | 7/22/2025 |
| 2025.1.24-beta | 224 | 7/16/2025 |
| 2025.1.23-beta | 165 | 7/12/2025 |
| 2024.2.5 | 333 | 12/31/2024 |
| 2024.1.3 | 296 | 11/10/2024 |
| 2022.2.7 | 460 | 5/1/2022 |
| 2022.2.5 | 394 | 5/1/2022 |