FastRng 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FastRng --version 1.0.0
NuGet\Install-Package FastRng -Version 1.0.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="FastRng" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FastRng --version 1.0.0
#r "nuget: FastRng, 1.0.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.
// Install FastRng as a Cake Addin
#addin nuget:?package=FastRng&version=1.0.0

// Install FastRng as a Cake Tool
#tool nuget:?package=FastRng&version=1.0.0

FastRng

FastRng is a multi-threaded pseudo-random number generator. Besides the generation of uniformly distributed random numbers, there are several other distributions to choose from. For performance reasons the parameters of the distributions are not user-definable. For some distributions, therefore, different parameter variations are available. If a different combination is desired, a separate class can be created.

Please note, that Math.NET's (https://www.mathdotnet.com/) random number generator is in some situations faster. Unlike Math.NET, MultiThreadedRng is multi-threaded and async. Consumers can await the next number without blocking resources. Additionally, consumers can use a token to cancel e.g. timeout an operation as well.

FastRng (class MultiThreadedRng) using a shape fitter (a rejection sampler) to enforce arbitrary shapes of probabilities for desired distributions. By using the shape fitter, it is even easy to define discontinuous, arbitrary functions as shapes. Any consumer can define and use own distributions.

The class MultiThreadedRng uses the George Marsaglia's MWC algorithm. The algorithm's implementation based loosely on John D. Cook's (johndcook.com) implementation. Thanks John for the inspiration.

Please notice: When using the debug environment, MultiThreadedRng uses a smaller buffer size. Please ensure, that the production environment uses a release build, though.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.2 252 11/14/2023
1.1.1 135 10/26/2023
1.1.0 149 7/10/2023
1.0.0 501 11/7/2020