Home All Groups Group Topic Archive Search About

Random Number between 0-86

Author
16 Mar 2006 5:34 PM
pmclinn
Is there a way to use the
System.Security.Cryptography.RNGCryptoServiceProvider to create a
number that is between 0 and 86?

-Peter

Author
16 Mar 2006 6:15 PM
Patrice
What is the goal ? My first though would be System.Random not knowing what
you are looking for...

--

"pmclinn" <pmcl***@gmail.com> a écrit dans le message de news:
1142530494.633202.88***@j33g2000cwa.googlegroups.com...
Show quoteHide quote
> Is there a way to use the
> System.Security.Cryptography.RNGCryptoServiceProvider to create a
> number that is between 0 and 86?
>
> -Peter
>
Author
16 Mar 2006 7:41 PM
pmclinn
I'm looking to create a truely random number for a password algorythm.
Author
17 Mar 2006 9:45 AM
Patrice
Then you could just use "modulus" so that the value is back in the needed
range (for each byte + perhaps adding a constant). If you do this for each
byte you'll have a random suite of printable chars.

--
Patrice

"pmclinn" <pmcl***@gmail.com> a écrit dans le message de news:
1142538072.499744.284***@u72g2000cwu.googlegroups.com...
Show quoteHide quote
> I'm looking to create a truely random number for a password algorythm.
>
Author
16 Mar 2006 9:08 PM
Kerry Moorman
Peter,

This article shows how to use RNGCryptoServiceProvider to generate random
numbers:
http://msdn2.microsoft.com/en-us/library/system.security.cryptography.rngcryptoserviceprovider.aspx

Kerry Moorman


Show quoteHide quote
"pmclinn" wrote:

> Is there a way to use the
> System.Security.Cryptography.RNGCryptoServiceProvider to create a
> number that is between 0 and 86?
>
> -Peter
>
>