A
almurph
Hi,
Hope you can help me with this one. I am trying to create random
number between 0 and 1 inclusive of cryptographiuc quality.
The problems is though - I don't know how! Here is what I have so far
and I would greatly appreciate any comments/suggestions/code-samples
that you may like to share. Thank you.
Al
**** CODE AS FOLLOWS ****
byte[] random = new byte[2];
RNGCryptoServiceProvider rng = new
RNGCryptoServiceProvider();
rng.GetBytes (random);
return Convert.ToDouble(random[0]);
*** END CODE ***
The prblem with the above is that it produces very large numbers. I
nned numbers between 0 and 1.
Hope you can help me with this one. I am trying to create random
number between 0 and 1 inclusive of cryptographiuc quality.
The problems is though - I don't know how! Here is what I have so far
and I would greatly appreciate any comments/suggestions/code-samples
that you may like to share. Thank you.
Al
**** CODE AS FOLLOWS ****
byte[] random = new byte[2];
RNGCryptoServiceProvider rng = new
RNGCryptoServiceProvider();
rng.GetBytes (random);
return Convert.ToDouble(random[0]);
*** END CODE ***
The prblem with the above is that it produces very large numbers. I
nned numbers between 0 and 1.