https://github.com/sepppenner/dotneteasyrandom
EasyRandom for .Net is an assembly/ library to generate random numbers with the internal Random library from .Net more easy.
https://github.com/sepppenner/dotneteasyrandom
Last synced: about 1 year ago
JSON representation
EasyRandom for .Net is an assembly/ library to generate random numbers with the internal Random library from .Net more easy.
- Host: GitHub
- URL: https://github.com/sepppenner/dotneteasyrandom
- Owner: SeppPenner
- License: mit
- Created: 2016-12-24T10:33:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-05T21:38:51.000Z (over 1 year ago)
- Last Synced: 2025-04-02T00:24:41.854Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 15.1 MB
- Stars: 3
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: License.txt
Awesome Lists containing this project
README
DotNetEasyRandom
====================================
DotNetEasyRandom is an assembly/ library to generate random numbers with the internal Random library from .Net more easily.
[](https://ci.appveyor.com/project/SeppPenner/dotneteasyrandom)
[](https://github.com/SeppPenner/DotNetEasyRandom/issues)
[](https://github.com/SeppPenner/DotNetEasyRandom/network)
[](https://github.com/SeppPenner/DotNetEasyRandom/stargazers)
[](https://raw.githubusercontent.com/SeppPenner/DotNetEasyRandom/master/License.txt)
[](https://www.nuget.org/packages/HaemmerElectronics.SeppPenner.DotNetEasyRandom/)
[](https://www.nuget.org/packages/HaemmerElectronics.SeppPenner.DotNetEasyRandom/)
[](https://snyk.io/test/github/SeppPenner/DotNetEasyRandom)
[](https://matrix.to/#/#DotNetEasyRandom_community:gitter.im)
[](https://franzhuber23.blogspot.de/)
[](https://patreon.com/SeppPennerOpenSourceDevelopment)
[](https://paypal.me/th070795)
## Available for
* Net 8.0
* Net 9.0
## Net Core and Net Framework latest and LTS versions
* https://dotnet.microsoft.com/download/dotnet
## Basic usage
```csharp
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.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
```bash
dotnet add package HaemmerElectronics.SeppPenner.DotNetEasyRandom
```
Change history
--------------
See the [Changelog](https://github.com/SeppPenner/DotNetEasyRandom/blob/master/Changelog.md).