RandomCS 1.0.1

dotnet add package RandomCS --version 1.0.1
                    
NuGet\Install-Package RandomCS -Version 1.0.1
                    
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="RandomCS" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RandomCS" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="RandomCS" />
                    
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 RandomCS --version 1.0.1
                    
#r "nuget: RandomCS, 1.0.1"
                    
#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 RandomCS@1.0.1
                    
#: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=RandomCS&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=RandomCS&version=1.0.1
                    
Install as a Cake Tool

RandomCS

Usage

  • Fast random value generation
  • Cryptographically secure random number generation

How to use

Non-Secure RNG

using BenScr.Random;

RandomCS random = new RandomCS();
int randomInt = RandomHandler.NextInt(0, 10);
float randomFloat = RandomHandler.NextFloat(0.0f, 10.0f);
bool randomBool = random.NextBool();
string randomString = random.NextString();

Safe RNG

using BenScr.Security.Cryptography;

RandomSecure random = new RandomSecure();
int randomInt = random.NextInt(0, 10);
float randomFloat = random.NextFloat(0.0f, 10.0f);
bool randomBool = random.NextBool();
string randomString = random.NextString();

Static Helper Class

using BenScr.Security.Cryptography;

// Non-Secure
int randomInt = RandomHandler.NextInt(0, 10);
inr randomFloat = RandomHandler.NextFloat(0.0f, 10.0f);

// Secure
int randomInt = RandomHandler.Secure.NextInt(0, 10);
int randomFloat = RandomHandler.Secure.NextFloat(0.0f, 10.0f);

Generic Functions

// Works with RandomCS, RandomSecure and RandomHandler
int randomInt = random.Next<int>(0, 10);
float randomFloat = random.Next<float>(0.0f, 10.0f);
bool randomBool = random.Next<bool>();
string randomString = random.Next<string>();

Support

Ko-fi Linktree

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RandomCS:

Package Downloads
UtilityCS

A Wide Range C# Utility Library

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 283 11/16/2025
1.0.0 284 11/16/2025