Tree3.Converter
2.0.0
See the version list below for details.
dotnet add package Tree3.Converter --version 2.0.0
NuGet\Install-Package Tree3.Converter -Version 2.0.0
<PackageReference Include="Tree3.Converter" Version="2.0.0" />
<PackageVersion Include="Tree3.Converter" Version="2.0.0" />
<PackageReference Include="Tree3.Converter" />
paket add Tree3.Converter --version 2.0.0
#r "nuget: Tree3.Converter, 2.0.0"
#:package Tree3.Converter@2.0.0
#addin nuget:?package=Tree3.Converter&version=2.0.0
#tool nuget:?package=Tree3.Converter&version=2.0.0
Tree3.Converter
Tree3.Converter is a lightweight .NET library for converting between binary, decimal, octal and hexadecimal, supporting arbitrarily large numbers, input validation, and reusable utility methods.
Features
- Asynchronous API � all operations return
Task<string>, ready for use in async workflows. - Arbitrary-precision integer support � operands are passed as strings, enabling conversion with values larger than
longlimits. - Simple, extensible interface � easy to implement with any numeric backend (e.g.,
BigInteger, external converter service, or distributed engine). - Consistent method naming � unified API for converting between binary, decimal, octal and hexadecimal numbers.
- Serialization-friendly � string inputs/outputs integrate seamlessly with JSON APIs and network-based systems.
- Testable and mockable � ideal for dependency injection and unit testing scenarios.
- Cross-platform � built for .NET 9.0, works on Windows, Linux, and macOS.
Usage
using Tree3.Converter;
var binaryConverter = new BinaryConverter();
var result = await binaryConverter.ToDecimalAsync("1101");
// Output: "13"
var decimalConverter = new DecimalConverter();
var result = await decimalConverter.ToBinaryAsync("13");
// Output: "1101"
var decimalConverter = new DecimalConverter();
var octalConverter = new OctalConverter();
var hexadecimalConverter = new HexadecimalConverter();
var octal = await decimalConverter.ToOctalAsync("13");
var hexadecimal = await octalConverter.ToHexadecimalAsync(octal);
var binary = await hexadecimalConverter.ToBinaryAsync(hdecimal);
// Output: "1101"
var decimalConverter = new DecimalConverter();
var result = await decimalConverter.ToBinaryAsync("-13");
// Output: "N/A"
Performance
NET 9 / Windows 11 / Intel i5 CPU
Converts a binary number with 100,000 digits to decimal in ~0.5 seconds.
Converts a binary number with 100,000 digits to octal in ~0.004 seconds.
Converts a binary number with 100,000 digits to hexadecimal in ~0.6 seconds.
Converts a decimal number with 100,000 digits to binary in ~7 seconds on.
Converts a decimal number with 100,000 digits to octal in ~7 seconds on.
Converts a decimal number with 100,000 digits to hexadecimal in ~0.01 seconds on.
Converts a octal number with 100,000 digits to binary in ~0.01 seconds on.
Converts a octal number with 100,000 digits to decimal in ~5 seconds on.
Converts a octal number with 100,000 digits to hexadecimal in ~4.9 seconds on.
Converts a hexadecimal number with 100,000 digits to binary in ~10 seconds on.
Converts a hexadecimal number with 100,000 digits to decimal in ~1 seconds on.
Converts a hexadecimal number with 100,000 digits to octal in ~10 seconds on.
Release Notes
v2.0.0 � 2025-11-14
- Added
IBinaryConverter, IDecimalConverter, IOctalConverter, IHexadecimalConverterinterfaces for asynchronous non-negative integer conversion. - Supported operations:
IBinaryConverter:ToDecimalAsync(string number)ToOctalAsync(string number)ToHexadecimalAsync(string number)
IDecimalConverter:ToBinaryAsync(string number)ToOctalAsync(string number)ToHexadecimalAsync(string number)
IOctalConverter:ToBinaryAsync(string number)ToDecimalAsync(string number)ToHexadecimalAsync(string number)
IHexadecimalConverter:ToBinaryAsync(string number)ToDecimalAsync(string number)ToOctalAsync(string number)
- All methods return results as
stringvalues, allowing support for very large numbers. - Compatible with .NET 9.0.
- Designed for extensibility and dependency injection.
v1.1.0
- Refactored converter logic for performance and readability.
- Enhanced validation for decimal and binary inputs.
- Made all converter and validator classes static.
- Added reusable
Utilitiesclasses.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Tree3.Converter:
| Package | Downloads |
|---|---|
|
Tree3.Calculator
Performs addition, subtraction, multiplication, division, and modulo operations on arbitrarily large non-negative integers represented as strings. |
GitHub repositories
This package is not used by any popular GitHub repositories.
- Added `IBinaryConverter, IDecimalConverter, IOctalConverter, IHexadecimalConverter` interfaces for asynchronous non-negative integer conversion.
- Supported operations:
- `IBinaryConverter` :
- `ToDecimalAsync(string number)`
- `ToOctalAsync(string number)`
- `ToHexadecimalAsync(string number)`
- `IDecimalConverter` :
- `ToBinaryAsync(string number)`
- `ToOctalAsync(string number)`
- `ToHexadecimalAsync(string number)`
- `IOctalConverter` :
- `ToBinaryAsync(string number)`
- `ToDecimalAsync(string number)`
- `ToHexadecimalAsync(string number)`
- `IHexadecimalConverter` :
- `ToBinaryAsync(string number)`
- `ToDecimalAsync(string number)`
- `ToOctalAsync(string number)`
- All methods return results as `string` values, allowing support for very large numbers.
- Compatible with **.NET 9.0**.
- Designed for extensibility and dependency injection.