https://github.com/soenneker/soenneker.utils.random
A thread-safe random utility library
https://github.com/soenneker/soenneker.utils.random
csharp dotnet random utility
Last synced: 3 months ago
JSON representation
A thread-safe random utility library
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.utils.random
- Owner: soenneker
- License: mit
- Created: 2023-02-09T03:20:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-09T21:39:03.000Z (4 months ago)
- Last Synced: 2026-03-10T00:53:39.594Z (4 months ago)
- Topics: csharp, dotnet, random, utility
- Language: C#
- Homepage: https://soenneker.com
- Size: 161 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/Soenneker.Utils.Random/)
[](https://github.com/soenneker/soenneker.utils.random/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/Soenneker.Utils.Random/)
[](https://github.com/soenneker/soenneker.utils.random/actions/workflows/codeql.yml)
#  Soenneker.Utils.Random
### A thread-safe random utility library
## Installation
```
dotnet add package Soenneker.Utils.Random
```
## Usage
```csharp
// Returns an integer >= 5, and < 20
RandomUtil.Next(5, 20);
```
```csharp
// Returns a double >= 5, and < 20
RandomUtil.NextDouble(5, 20);
```
```csharp
// Returns a random number with a uniform and discrete distribution
RandomUtil.NextDecimalUniform(5, 20);
```