Base58Encoding 0.0.3
dotnet add package Base58Encoding --version 0.0.3
NuGet\Install-Package Base58Encoding -Version 0.0.3
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="Base58Encoding" Version="0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Base58Encoding" Version="0.0.3" />
<PackageReference Include="Base58Encoding" />
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 Base58Encoding --version 0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Base58Encoding, 0.0.3"
#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 Base58Encoding@0.0.3
#: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=Base58Encoding&version=0.0.3
#tool nuget:?package=Base58Encoding&version=0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Base58 Encoding Library
A .NET 9.0 Base58 encoding and decoding library with support for multiple alphabet variants.
Features
- Multiple Alphabets: Built-in support for Bitcoin(IFPS/Sui), Ripple, and Flickr alphabets
- Memory Efficient: Uses span operations to minimize allocations
- Type Safe: Leverages ReadOnlySpan and ReadOnlyMemory for safe operations
- Intrinsics: Uses SIMD
Vector128/Vector256
and unrolled loop for counting leading zeros
Usage
using Base58Encoding;
// Encode bytes to Base58 Bitcoin(IFPS/Sui) alphabet
byte[] data = { 0x01, 0x02, 0x03, 0x04 };
string encoded = Base58.Bitcoin.Encode(data);
// Decode Base58 string back to bytes
byte[] decoded = Base58.Bitcoin.Decode(encoded);
// Ripple / Flickr
Base58.Ripple.Encode(data);
Base58.Flickr.Encode(data);
// Custom
new Base58(Base58Alphabet.Custom(""));
Benchmarks
BenchmarkDotNet v0.13.12, Windows 11 (10.0.26100.4946)
13th Gen Intel Core i7-13700KF, 1 CPU, 24 logical and 16 physical cores
.NET SDK 9.0.304
[Host] : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
.NET 9.0 : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
Job=.NET 9.0 Runtime=.NET 9.0
Method | DataSize | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio |
---|---|---|---|---|---|---|---|---|---|---|
'Our Base58 Encode' | 8 | 51.62 ns | 0.557 ns | 0.521 ns | 51.62 ns | 1.81 | 0.04 | 0.0030 | 48 B | 1.50 |
'SimpleBase Base58 Encode' | 8 | 55.59 ns | 0.251 ns | 0.234 ns | 55.59 ns | 1.95 | 0.03 | 0.0030 | 48 B | 1.50 |
'NBitcoin Base58 Encode' | 8 | 63.25 ns | 1.229 ns | 1.366 ns | 63.07 ns | 2.23 | 0.05 | 0.0030 | 48 B | 1.50 |
'Our Base58 Decode' | 8 | 28.57 ns | 0.528 ns | 0.494 ns | 28.54 ns | 1.00 | 0.00 | 0.0020 | 32 B | 1.00 |
'SimpleBase Base58 Decode' | 8 | 62.70 ns | 0.597 ns | 0.558 ns | 62.45 ns | 2.20 | 0.04 | 0.0020 | 32 B | 1.00 |
'Our Base58 Encode' | 13 | 125.03 ns | 1.721 ns | 1.525 ns | 124.68 ns | 2.11 | 0.03 | 0.0041 | 64 B | 1.60 |
'SimpleBase Base58 Encode' | 13 | 143.07 ns | 1.342 ns | 1.256 ns | 143.22 ns | 2.41 | 0.05 | 0.0041 | 64 B | 1.60 |
'NBitcoin Base58 Encode' | 13 | 152.49 ns | 1.776 ns | 1.661 ns | 153.13 ns | 2.57 | 0.04 | 0.0041 | 64 B | 1.60 |
'Our Base58 Decode' | 13 | 59.34 ns | 0.876 ns | 0.776 ns | 59.35 ns | 1.00 | 0.00 | 0.0025 | 40 B | 1.00 |
'SimpleBase Base58 Decode' | 13 | 158.13 ns | 0.529 ns | 0.495 ns | 158.19 ns | 2.66 | 0.04 | 0.0024 | 40 B | 1.00 |
'Our Base58 Encode' | 32 | 900.00 ns | 13.132 ns | 11.641 ns | 899.01 ns | 3.05 | 0.04 | 0.0067 | 112 B | 2.00 |
'SimpleBase Base58 Encode' | 32 | 956.71 ns | 6.189 ns | 5.789 ns | 955.69 ns | 3.24 | 0.02 | 0.0057 | 112 B | 2.00 |
'NBitcoin Base58 Encode' | 32 | 1,215.07 ns | 11.678 ns | 10.923 ns | 1,216.22 ns | 4.11 | 0.04 | 0.0057 | 112 B | 2.00 |
'Our Base58 Decode' | 32 | 295.31 ns | 1.387 ns | 1.297 ns | 295.56 ns | 1.00 | 0.00 | 0.0033 | 56 B | 1.00 |
'SimpleBase Base58 Decode' | 32 | 693.05 ns | 5.673 ns | 5.306 ns | 691.92 ns | 2.35 | 0.02 | 0.0029 | 56 B | 1.00 |
'Our Base58 Encode' | 69 | 4,515.29 ns | 18.892 ns | 15.776 ns | 4,519.64 ns | 2.41 | 0.82 | 0.0076 | 216 B | 2.25 |
'SimpleBase Base58 Encode' | 69 | 6,924.91 ns | 137.444 ns | 251.323 ns | 7,064.97 ns | 3.08 | 0.74 | 0.0076 | 216 B | 2.25 |
'NBitcoin Base58 Encode' | 69 | 7,536.47 ns | 150.542 ns | 282.753 ns | 7,613.02 ns | 3.36 | 0.79 | 0.0076 | 216 B | 2.25 |
'Our Base58 Decode' | 69 | 2,403.76 ns | 87.230 ns | 257.200 ns | 2,503.34 ns | 1.00 | 0.00 | 0.0057 | 96 B | 1.00 |
'SimpleBase Base58 Decode' | 69 | 4,697.46 ns | 447.955 ns | 1,320.805 ns | 3,896.45 ns | 1.98 | 0.58 | - | 96 B | 1.00 |
License
This project is available under the MIT License.
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.