LX4Cnh 1.1.0
dotnet add package LX4Cnh --version 1.1.0
NuGet\Install-Package LX4Cnh -Version 1.1.0
<PackageReference Include="LX4Cnh" Version="1.1.0" />
paket add LX4Cnh --version 1.1.0
#r "nuget: LX4Cnh, 1.1.0"
// Install LX4Cnh as a Cake Addin
#addin nuget:?package=LX4Cnh&version=1.1.0
// Install LX4Cnh as a Cake Tool
#tool nuget:?package=LX4Cnh&version=1.1.0
Algorithm for high-speed multiplication of LARGE numbers; [0]
Read about LX4Cnh and related: 📑 https://www.reddit.com/r/x3F/comments/ovq368/highspeed_multiplication_of_large_numbers_fast/
Copyright (c) 2021 Denis Kuzmin <x-3F@outlook.com> github/3F
MLnoCS vs LX4Cnh
Algorithm | Maximum bits | One multiplication |
---|---|---|
LX4Cnh | 128+ × 128+ | less than ~ 4.3 ns == 0.0000000043 sec |
MLnoCS | 128+ × 16 (*[1] 32) | less than ~ 0.31 ns == 0.00000000031 sec |
LX4Cnh optimized*[2] | 128+ × 128+ | *[2] less than ~ 0.86 ns == 0.00000000086 sec |
- *[1] - theoretically up to 128 x 32 with some correction.
- *[2] - The actual calculation using LX4Cnh can be a bit optimized such for FNV1a-128 implementation (find it in my repo):
(1 ns == 0.000000001 sec)
Where is this used?
Huid - A high-speed FNV-1a-128 hash-based UUID implementation.
Fnv1a128 - Non-cryptographic hash function. FNV-1a. 「 128-bit 」 implementation.
.NET implementation
128-bit numbers (full range, 128 × 128) 
LX4Cnh class provides several ways of setting and getting numbers by using uint, ulong, or bytes array. Just play with available Unit-Tests and Speed-Tests.
For example, using ulong (UInt64)
// 0x4BD4823ECC5D03EB19E07DB8FFD5DABE
// × 0x1D05906000069ABC40A30C07A70906D1
ulong high = LX4Cnh.Multiply
(
0x4BD4823ECC5D03EB, 0x19E07DB8FFD5DABE,
0x1D05906000069ABC, 0x40A30C07A70906D1,
out ulong low
);
// high low
// ________________|_______________
// = 0xACBBE8EAB60C77E249B25D708366091E
LX4Cnh core algorithm: 1.0
LX4Cnh for .NET: 1.1.0.2080+d76d867
Configuration: RCI
Platforms: net40;net472;netcoreapp2.1;net5;netstandard2.0:: generated by a vsSolutionBuildEvent 1.14.1.34071
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETCoreApp 2.1
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net5.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.
Version | Downloads | Last updated |
---|---|---|
1.1.0 | 1,603 | 7/26/2021 |