random number generators

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

does anyone have good random number generator?
the .NET one does not generate a wide enough range of values as i have to
populate a psuedo array that has approx 500 million entries, using the .NET
generator the same sequence eventually repeats.
oh it has to fast too :)
 
Don't use the same Random object to create all the numbers. Create a new
object after you have used it to get a certain amount of random numbers.

There is a better random generator used to create encryption keys in the
encryption classes. I think that it's quite a bit slower than the Random
class, though.

Here is a faster replacement for the Random class:

http://www.codeproject.com/csharp/fastrandom.asp

I expect it to be repeating the pattern just as the Random class,
though, or even more often, so you would have to create new ones at an
interval, just as with the Random class.
 
many thanks Goran


Göran Andersson said:
Don't use the same Random object to create all the numbers. Create a new
object after you have used it to get a certain amount of random numbers.

There is a better random generator used to create encryption keys in the
encryption classes. I think that it's quite a bit slower than the Random
class, though.

Here is a faster replacement for the Random class:

http://www.codeproject.com/csharp/fastrandom.asp

I expect it to be repeating the pattern just as the Random class,
though, or even more often, so you would have to create new ones at an
interval, just as with the Random class.
 
Back
Top