Attribution Required


  • Perpetual license (does not expire)
  • 1 site, 1 server
  • No distribution (hosted use only)
  • Commercial use allowed
  • Attribution required
Free Read License

Developer License


  • Perpetual license (does not expire)
  • Unlimited projects
  • Can distribute code and binary products
  • Commercial use allowed
  • 1 year support
$9.99 Read License

14 Day money-back guarantee

Full refund within 14 days of purchase date.

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Jun 22, 2011
    Last Update: Jun 22, 2011
  • Language: VB.NET
  • Category: Security

JCRandom

JCRandom
Developed by Salvador Arnal Julian, Released Jun 22, 2011

Better random number generator than the Random class provided with the .NET framework

VB.NET

Tags: random

If you work with the Random class provided with the .NET framework, you will notice that if you initializes two objects with the same seed you will get the same random series.

This pseudo-random number generator not only avoids this unwanted behavior, also offers a better randomness

Back to top

Documentation

Usage

Just add the file JCRandom.vb into your project.

Example code

' Initializes a new instance.
dim r as new JCRandom()      

' Returns a random number between 0.0 and 1.0.
r.NextDouble()

' Returns a random Int32.
r.Next()                                

' Returns a nonnegative random number less than the specified value
r.Next(25)                                

' Returns a random number within a specified range.
r.Next(100,200)                                

' Returns a random byte.
r.NextByte()            

' Fills the elements of a specified array of bytes with random numbers.
r.NextBytes(buffer)

' Returns a random string created with letters and numbers.
r.NextString(16)

User Reviews

No reviews have been submitted yet.

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.