473,396 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Random Number between 0-86

Is there a way to use the
System.Security.Cryptography.RNGCryptoServiceProvi der to create a
number that is between 0 and 86?

-Peter

Mar 16 '06 #1
4 901
What is the goal ? My first though would be System.Random not knowing what
you are looking for...

--

"pmclinn" <pm*****@gmail.com> a écrit dans le message de news:
11*********************@j33g2000cwa.googlegroups.c om...
Is there a way to use the
System.Security.Cryptography.RNGCryptoServiceProvi der to create a
number that is between 0 and 86?

-Peter

Mar 16 '06 #2
I'm looking to create a truely random number for a password algorythm.

Mar 16 '06 #3
Peter,

This article shows how to use RNGCryptoServiceProvider to generate random
numbers:

http://msdn2.microsoft.com/en-us/lib...eprovider.aspx

Kerry Moorman
"pmclinn" wrote:
Is there a way to use the
System.Security.Cryptography.RNGCryptoServiceProvi der to create a
number that is between 0 and 86?

-Peter

Mar 16 '06 #4
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" <pm*****@gmail.com> a écrit dans le message de news:
11**********************@u72g2000cwu.googlegroups. com...
I'm looking to create a truely random number for a password algorythm.

Mar 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Virus | last post by:
Ok well what I am trying to do is have 1.) the background color to change randomly with 5 different colors.(change on page load) 2,) 10 different quotes randomly fadeing in and out in random...
10
by: Johnny Snead | last post by:
Hey guys, Need help with this random sort algorithm private void cmdQuestion_Click(object sender, System.EventArgs e) { Random rnd = new Random(); //initialize rnd to new random object...
5
by: Peteroid | last post by:
I know how to use rand() to generate random POSITIVE-INTEGER numbers. But, I'd like to generate a random DOUBLE number in the range of 0.0 to 1.0 with resolution of a double (i.e., every possible...
4
by: fatimahtaher | last post by:
Hi, I am supposed to create a program that generates a random number and then asks the user to guess the number (1-100). The program tells the user if he guessed too high or too low. If he...
13
by: Peter Oliphant | last post by:
I would like to be able to create a random number generator that produces evenly distributed random numbers up to given number. For example, I would like to pick a random number less than 100000,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.