Czlovek.Randomness 1.0.10

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Czlovek.Randomness --version 1.0.10
                    
NuGet\Install-Package Czlovek.Randomness -Version 1.0.10
                    
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="Czlovek.Randomness" Version="1.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Czlovek.Randomness" Version="1.0.10" />
                    
Directory.Packages.props
<PackageReference Include="Czlovek.Randomness" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Czlovek.Randomness --version 1.0.10
                    
#r "nuget: Czlovek.Randomness, 1.0.10"
                    
#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.
#:package Czlovek.Randomness@1.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Czlovek.Randomness&version=1.0.10
                    
Install as a Cake Addin
#tool nuget:?package=Czlovek.Randomness&version=1.0.10
                    
Install as a Cake Tool

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 of Random that can be used freely within the current thread.
  • NewRandom(): Creates a new instance of Random with a seed derived from the global instance of Random.
  • Next(): Returns a random non-negative integer.
  • Next(int maxValue): Returns a random non-negative integer less than the specified maxValue.
  • 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 Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.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.73 134 11/6/2025
2.1.0-beta.72 134 11/6/2025
2.1.0-beta.71 132 11/4/2025
2.1.0-beta.70 132 11/4/2025
2.1.0-beta.69 133 11/4/2025
2.1.0-beta.68 133 11/4/2025
2.1.0-beta.67 148 11/2/2025
2.1.0-beta.66 144 11/2/2025
2.1.0-beta.65 76 11/1/2025
2.1.0-beta.64 73 11/1/2025
2.1.0-beta.63 73 11/1/2025
2.1.0-beta.62 74 11/1/2025
2.1.0-beta.61 138 10/12/2025
2.1.0-beta.59 148 8/13/2025
2.1.0-beta.58 126 8/13/2025
2.1.0-beta.57 130 8/13/2025
2.1.0-beta.56 125 8/12/2025
2.1.0-beta.55 123 8/12/2025
2.1.0-beta.54 129 8/10/2025
2.1.0-beta.53 126 8/10/2025
2.1.0-beta.52 126 8/10/2025
2.1.0-beta.51 94 8/9/2025
2.1.0-beta.50 94 8/9/2025
2.1.0-beta.49 96 8/9/2025
2.1.0-beta.48 97 8/9/2025
2.1.0-beta.47 102 8/9/2025
2.1.0-beta.46 147 7/29/2025
2.1.0-beta.45 101 7/29/2025
2.1.0-beta.44 100 7/29/2025
2.1.0-beta.43 146 7/5/2025
2.1.0-beta.42 131 6/23/2025
2.1.0-beta.41 86 6/6/2025
2.1.0-beta.40 68 6/6/2025
2.1.0-beta.38 158 6/3/2025
2.1.0-beta.37 132 5/27/2025
2.1.0-beta.36 73 5/10/2025
2.1.0-beta.35 57 5/10/2025
2.1.0-beta.34 58 5/10/2025
2.1.0-beta.33 214 4/10/2025
2.1.0-beta.32 142 4/9/2025
2.1.0-beta.31 141 4/9/2025
2.1.0-beta.30 140 4/9/2025
2.1.0-beta.29 139 4/9/2025
2.1.0-beta.28 186 3/11/2025
2.1.0-beta.27 170 3/9/2025
2.1.0-beta.26 114 3/8/2025
2.1.0-beta.25 117 3/8/2025
2.1.0-beta.24 207 3/6/2025
2.1.0-beta.23 187 3/4/2025
2.1.0-beta.22 189 3/4/2025
2.1.0-beta.21 109 2/23/2025
2.1.0-beta.20 71 2/22/2025
2.1.0-beta.19 68 2/22/2025
2.1.0-beta.18 83 2/22/2025
2.1.0-beta.17 77 2/22/2025
2.1.0-beta.16 73 2/22/2025
2.1.0-beta.15 74 2/22/2025
2.1.0-beta.14 79 2/22/2025
2.1.0-beta.13 78 2/22/2025
2.1.0-beta.12 80 2/22/2025
2.1.0-beta.11 90 2/21/2025
2.1.0-beta.10 87 2/20/2025
2.1.0-beta.9 81 1/20/2025
2.1.0-beta.8 77 1/20/2025
2.1.0-beta.7 71 1/20/2025
2.1.0-beta.6 70 1/20/2025
2.1.0-beta.5 81 1/19/2025
2.1.0-beta.4 65 1/19/2025
2.1.0-beta.3 71 1/19/2025
2.1.0-beta.2 64 1/19/2025
2.1.0-beta.1 63 1/19/2025
2.0.0-beta.8 229 8/25/2024
2.0.0-beta.7 223 6/11/2024
2.0.0-beta.5 73 6/11/2024
2.0.0-beta.4 80 6/10/2024
2.0.0-beta.3 86 5/19/2024
2.0.0-beta.2 767 2/7/2024
2.0.0-beta.1 101 1/18/2024
1.0.11-beta.40 160 12/17/2023
1.0.11-beta.39 121 12/10/2023
1.0.11-beta.38 121 11/26/2023
1.0.11-beta.37 85 11/26/2023
1.0.11-beta.36 90 11/25/2023
1.0.11-beta.35 87 11/25/2023
1.0.11-beta.34 93 11/25/2023
1.0.11-beta.33 98 11/25/2023
1.0.11-beta.32 101 11/25/2023
1.0.11-beta.31 91 11/23/2023
1.0.11-beta.30 98 11/18/2023
1.0.11-beta.29 87 11/17/2023
1.0.11-beta.28 90 11/17/2023
1.0.11-beta.27 83 11/16/2023
1.0.11-beta.26 83 11/16/2023
1.0.11-beta.25 92 11/16/2023
1.0.11-beta.24 113 11/1/2023
1.0.11-beta.23 87 10/31/2023
1.0.11-beta.22 155 9/11/2023
1.0.11-beta.21 118 9/10/2023
1.0.11-beta.20 185 8/26/2023
1.0.11-beta.19 130 8/18/2023
1.0.11-beta.18 135 8/17/2023
1.0.11-beta.17 122 8/17/2023
1.0.11-beta.16 119 8/17/2023
1.0.11-beta.15 111 8/17/2023
1.0.11-beta.14 129 8/15/2023
1.0.11-beta.13 180 8/11/2023
1.0.11-beta.12 130 8/11/2023
1.0.11-beta.11 138 8/3/2023
1.0.11-beta.10 142 8/1/2023
1.0.11-beta.9 140 7/11/2023
1.0.11-beta.8 133 7/11/2023
1.0.11-beta.7 133 7/11/2023
1.0.11-beta.6 147 5/16/2023
1.0.11-beta.5 141 5/16/2023
1.0.11-beta.4 139 5/16/2023
1.0.11-beta.3 143 5/16/2023
1.0.11-beta.2 141 5/16/2023
1.0.11-beta.1 144 5/14/2023
1.0.10 787 4/11/2023
1.0.10-beta.2 158 4/11/2023
1.0.10-beta.1 169 3/22/2023
1.0.9 367 3/22/2023
1.0.8 388 3/19/2023
1.0.7 391 3/19/2023
1.0.6 400 3/16/2023
1.0.6-beta.1 152 3/16/2023
1.0.5 389 3/16/2023
1.0.4 407 3/12/2023