Czlovek.Randomness
2.1.0-beta.74
See the version list below for details.
dotnet add package Czlovek.Randomness --version 2.1.0-beta.74
NuGet\Install-Package Czlovek.Randomness -Version 2.1.0-beta.74
<PackageReference Include="Czlovek.Randomness" Version="2.1.0-beta.74" />
<PackageVersion Include="Czlovek.Randomness" Version="2.1.0-beta.74" />
<PackageReference Include="Czlovek.Randomness" />
paket add Czlovek.Randomness --version 2.1.0-beta.74
#r "nuget: Czlovek.Randomness, 2.1.0-beta.74"
#:package Czlovek.Randomness@2.1.0-beta.74
#addin nuget:?package=Czlovek.Randomness&version=2.1.0-beta.74&prerelease
#tool nuget:?package=Czlovek.Randomness&version=2.1.0-beta.74&prerelease
Randomness
Utils is a static class for generating random numbers. It contains a global instance of Random used to generate seeds, which are then used to create new instances of Random on a per-thread basis.
Usage
To use Utils, simply call one of the provided static methods:
var randomInt = Utils.Next();
var randomDouble = Utils.NextDouble();
var randomBytes = new byte[16];
Utils.NextBytes(randomBytes);
If you need to use a Random instance across multiple methods or threads, you can create a new instance of Random using Utils.NewRandom():
var random = Utils.NewRandom();
var randomInt = random.Next();
Note that NewRandom() will create a new instance of Random with a seed derived from the global instance of Random. If you need a more secure seed, you should use a cryptographic random number generator instead.
Methods
Instance: Returns a thread-local instance ofRandomthat can be used freely within the current thread.NewRandom(): Creates a new instance ofRandomwith a seed derived from the global instance ofRandom.Next(): Returns a random non-negative integer.Next(int maxValue): Returns a random non-negative integer less than the specifiedmaxValue.Next(int minValue, int maxValue): Returns a random integer within the specified range.NextDouble(): Returns a random double between 0.0 and 1.0.NextBytes(byte[] buffer): Fills the specified byte array with random numbers.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Czlovek.Randomness:
| Package | Downloads |
|---|---|
|
Czlovek.Security
A collection of methods for generating, hashing, and encrypting data. |
|
|
Czlovek.HttpCommunication
Provides various methods for generating random user agent strings. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0-beta.84 | 55 | 5/7/2026 |
| 2.1.0-beta.83 | 53 | 5/7/2026 |
| 2.1.0-beta.82 | 97 | 3/20/2026 |
| 2.1.0-beta.81 | 74 | 2/21/2026 |
| 2.1.0-beta.80 | 68 | 2/21/2026 |
| 2.1.0-beta.79 | 78 | 2/13/2026 |
| 2.1.0-beta.78 | 76 | 2/11/2026 |
| 2.1.0-beta.77 | 65 | 2/11/2026 |
| 2.1.0-beta.76 | 70 | 2/10/2026 |
| 2.1.0-beta.75 | 73 | 2/10/2026 |
| 2.1.0-beta.74 | 78 | 1/28/2026 |
| 2.1.0-beta.73 | 204 | 11/6/2025 |
| 2.1.0-beta.72 | 175 | 11/6/2025 |
| 2.1.0-beta.71 | 185 | 11/4/2025 |
| 2.1.0-beta.70 | 187 | 11/4/2025 |
| 2.1.0-beta.69 | 176 | 11/4/2025 |
| 2.1.0-beta.68 | 176 | 11/4/2025 |
| 2.1.0-beta.67 | 194 | 11/2/2025 |
| 2.1.0-beta.66 | 183 | 11/2/2025 |
| 1.0.10 | 885 | 4/11/2023 |