HaemmerElectronics.SeppPenner.DotNetEasyRandom
1.0.14
Prefix Reserved
dotnet add package HaemmerElectronics.SeppPenner.DotNetEasyRandom --version 1.0.14
NuGet\Install-Package HaemmerElectronics.SeppPenner.DotNetEasyRandom -Version 1.0.14
<PackageReference Include="HaemmerElectronics.SeppPenner.DotNetEasyRandom" Version="1.0.14" />
<PackageVersion Include="HaemmerElectronics.SeppPenner.DotNetEasyRandom" Version="1.0.14" />
<PackageReference Include="HaemmerElectronics.SeppPenner.DotNetEasyRandom" />
paket add HaemmerElectronics.SeppPenner.DotNetEasyRandom --version 1.0.14
#r "nuget: HaemmerElectronics.SeppPenner.DotNetEasyRandom, 1.0.14"
#:package HaemmerElectronics.SeppPenner.DotNetEasyRandom@1.0.14
#addin nuget:?package=HaemmerElectronics.SeppPenner.DotNetEasyRandom&version=1.0.14
#tool nuget:?package=HaemmerElectronics.SeppPenner.DotNetEasyRandom&version=1.0.14
DotNetEasyRandom
DotNetEasyRandom is an assembly/ library to generate random numbers with the internal Random library from .Net more easily.
Available for
- Net 8.0
- Net 10.0
Net Core and Net Framework latest and LTS versions
Basic usage
public class ExampleUsage
{
private readonly IEasyRandom _random = new EasyRandom(); //Normal construtor
private readonly IEasyRandom _random2 = new EasyRandom(12); //Construtor with seed
public void Test()
{
_random.Next(); //Function from the "normal" Random class
_random.Next(12); //Function from the "normal" Random class
_random.Next(1, 5, IncludeType.None); //Gives back 2, 3 or 4
_random.Next(1, 5, IncludeType.StartOnly); //Gives back 1, 2, 3 or 4
_random.Next(1, 5, IncludeType.EndOnly); //Gives back 2, 3, 4 or 5
_random.Next(1, 5, IncludeType.Both); //Gives back 1, 2, 3, 4 or 5
_random.Next(1, 2, IncludeType.None);
//Throws a NoValueBetweenParametersException, both candidates are excluded borders
_random.NextBytes(new byte[] {1, 2, 3, 4}); //Function from the "normal" Random class
_random.NextDouble(); //Function from the "normal" Random class
_random.NextDoubleExcludedBoth(1.0, 2.0);
//Gives back a double value between 1.0 and 2.0 EXCLUDING the borders
//(e.g. from 1.0000000000000000000000000000000001 to 1.9999999999999999999999999999999999
}
}
Install
dotnet add package HaemmerElectronics.SeppPenner.DotNetEasyRandom
Change history
See the Changelog.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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. |
-
net10.0
- No dependencies.
-
net8.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 1.0.14.0 (2026-08-11): Removed support for Net9.0 as it is out of support, added support for Net10.0, updated NuGet packages, the XML documentation is now part of the package, IncludeType.None throws a NoValueBetweenParametersException for neighbouring parameters instead of returning the excluded maximum value, an unknown include type throws an ArgumentOutOfRangeException instead of returning 0, NextDoubleExcludedBoth does not return the minimum value any more, the MinMustBeGreaterThanMaxException tells the caller that the minimum must be less than the maximum, removed the inner exceptions that only repeated the message of the outer exception, added a MSTest test project.