AnyBase.Net 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AnyBase.Net --version 1.1.0
                    
NuGet\Install-Package AnyBase.Net -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AnyBase.Net" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AnyBase.Net" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AnyBase.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AnyBase.Net --version 1.1.0
                    
#r "nuget: AnyBase.Net, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AnyBase.Net@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AnyBase.Net&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AnyBase.Net&version=1.1.0
                    
Install as a Cake Tool

AnyBase.Net

CI NuGet Tool Playground

Codifica e decodifica byte o testo UTF-8 usando un alfabeto ordinato qualsiasi. Ogni byte è rappresentato con una larghezza fissa, quindi il round-trip è deterministico anche con basi non potenze di due.

La versione 1.1.0 usa NumeralSystems.Net 5.3.0.

Installazione

dotnet add package AnyBase.Net --version 1.1.0

Uso

L'ordine dei simboli definisce il loro valore: il primo vale zero, il secondo uno e così via.

using AnyBase.Net;

var hexadecimal = new Base<char>("0123456789ABCDEF");

var encoded = hexadecimal.EncodeToString("Ciao 🌍");
// 4369616F20F09F8C8D

var decoded = hexadecimal.DecodeToString(encoded);
// Ciao 🌍

Sono supportati anche i byte arbitrari:

var binary = new Base<char>("01");
var source = new byte[] { 0, 1, 127, 128, 255 };

var symbols = binary.Encode(source);
var roundTrip = binary.DecodeToBytes(symbols);

Per alfabeti in cui ogni simbolo occupa più caratteri, l'overload che riceve un array di simboli evita qualsiasi ambiguità. La decodifica da stringa usa il matching più lungo e richiede rappresentazioni testuali uniche.

Playground WebAssembly

Il playground Blazor WebAssembly esegue tutto localmente nel browser e permette di:

  • scegliere basi 2, 8, 10, 16, 32 e 64;
  • definire un alfabeto personalizzato;
  • codificare e decodificare testo UTF-8;
  • invertire la trasformazione e copiare il risultato.

Per avviarlo in locale:

dotnet run --project AnyBase.Net/AnyBase.Net.Playground

Tool da riga di comando

Installa il .NET global tool:

dotnet tool install --global AnyBase.Net.Tool --version 1.1.0

Il comando installato è anybase:

anybase encode "Hello" --base 16
# 48656C6C6F

anybase decode 48656C6C6F --base 16
# Hello

anybase encode "Hello" --alphabet "01"

Sono disponibili --input <file|->, --output <file|->, stdin e basi da 2 a 64. Usa anybase --help per la sintassi completa.

Sviluppo

dotnet restore AnyBase.Net/AnyBase.Net.sln
dotnet build AnyBase.Net/AnyBase.Net.sln --configuration Release
dotnet test AnyBase.Net/AnyBase.Net.sln --configuration Release

La suite copre l'intero intervallo dei byte, Unicode UTF-8, alfabeti custom, input malformati e il contratto della CLI.

Le istruzioni per GitHub Pages e Trusted Publishing sono in docs/RELEASING.md.

Licenza

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.4.0 102 8/4/2026
1.3.0 108 8/2/2026
1.2.0 104 8/2/2026
1.1.1 120 8/1/2026
1.1.0 111 8/1/2026
1.0.1 180 12/9/2024

NumeralSystems.Net 5.3.0 support, UTF-8 text round trips, deterministic alphabets, and stricter validation.