A
almurph
Hi,
I'm trying to generate a pseudorandom *integral* number between the
range [min, max) of cryptographic quality.
At this moment in time as far as I've gotten is the ability to
generate a pseudorandom number between [0, 1) which is shown below.
Can you help me please achieve what i am trying to do? I do not wish
to use Random. I need better "quality" numbers...
Thanks in advance for any comments/suggestions/help code-samples that
you may be able to offer.
Al.
**** CODE AS FOLLOWS ****
//Pseudorandom number (of crypto strength) in range [0.0,1.0)
private double GetRandNumCrypto()
{
byte[] salt = new byte[8];
RNGCryptoServiceProvider rng = new
RNGCryptoServiceProvider();
rng.GetBytes(salt);
return (double)BitConverter.ToUInt64(salt, 0) /
UInt64.MaxValue ;
}
I'm trying to generate a pseudorandom *integral* number between the
range [min, max) of cryptographic quality.
At this moment in time as far as I've gotten is the ability to
generate a pseudorandom number between [0, 1) which is shown below.
Can you help me please achieve what i am trying to do? I do not wish
to use Random. I need better "quality" numbers...
Thanks in advance for any comments/suggestions/help code-samples that
you may be able to offer.
Al.
**** CODE AS FOLLOWS ****
//Pseudorandom number (of crypto strength) in range [0.0,1.0)
private double GetRandNumCrypto()
{
byte[] salt = new byte[8];
RNGCryptoServiceProvider rng = new
RNGCryptoServiceProvider();
rng.GetBytes(salt);
return (double)BitConverter.ToUInt64(salt, 0) /
UInt64.MaxValue ;
}