.NETGURU
System.Random class reliability
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngfw' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Thunder Bird
-- This message, which was originally sent to "aspngarchitecture", has been moved to "aspngfw" mailing list by the List Master --I'm using System.Random class to generate ID-s for my cutomers.I aslo use seeds while creating them to assure that all the ID-s generated are unique.Is there a possibility that aspng creators will change System.Random class random number generating system so that if I use the following sentence:int ID = (new System.Random(234)).Next(100000, 999999);in later years I will get different value to ID than I get it now.Please help me with this question, I can't really continue building my web application until I have got a confident answere to this.I could aslo use GUID (global identifier) but it is too long for purposes I use it for. Users wouldn't trouble to type that complex ID in.With best hopes and wishesPriit Raag-- everyday.com --
Reply to this message...
 
    
Scott (VIP)
If this is a high concern, there are plenty of open-source random
algorithms. You could simply roll-your-own pseudo-random number
generator.

Scott Swigart
3 Leaf Solutions LLC
www.3leafsolutions.com
503-281-9681

-----Original Message-----
From: Thunder Bird" <Click here to reveal e-mail address> [mailto:Click here to reveal e-mail address]

Sent: Saturday, August 25, 2001 2:01 AM
To: aspngfw
Subject: [aspngfw] System.Random class reliability

-- This message, which was originally sent to "aspngarchitecture", has
been moved to "aspngfw" mailing list by the List Master --

I'm using System.Random class to generate ID-s for my cutomers. I aslo
use seeds while creating them to assure that all the ID-s generated are
unique.

Is there a possibility that aspng creators will change System.Random
class random number generating system so that if I use the following
sentence: int ID =3D (new System.Random(234)).Next(100000, 999999); in
later years I will get different value to ID than I get it now.

Please help me with this question, I can't really continue building my
web application until I have got a confident answere to this.

I could aslo use GUID (global identifier) but it is too long for
purposes I use it for. Users wouldn't trouble to type that complex ID
in.

With best hopes and wishes
Priit Raag
-- everyday.com --

| [aspngfw] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngfw.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Scott (VIP)
One other thought. Guid's wouldn't help you if you need to "randomly"
generate the same number. You will never get the same GUID twice, no
matter what you do.

-----Original Message-----
From: Scott=20
Sent: Saturday, August 25, 2001 9:53 AM
To: aspngfw
Subject: [aspngfw] RE: System.Random class reliability

If this is a high concern, there are plenty of open-source random
algorithms. You could simply roll-your-own pseudo-random number
generator.

Scott Swigart
3 Leaf Solutions LLC
www.3leafsolutions.com
503-281-9681

-----Original Message-----
From: Thunder Bird" <Click here to reveal e-mail address> [mailto:Click here to reveal e-mail address]

Sent: Saturday, August 25, 2001 2:01 AM
To: aspngfw
Subject: [aspngfw] System.Random class reliability

-- This message, which was originally sent to "aspngarchitecture", has
been moved to "aspngfw" mailing list by the List Master --

I'm using System.Random class to generate ID-s for my cutomers. I aslo
use seeds while creating them to assure that all the ID-s generated are
unique.

Is there a possibility that aspng creators will change System.Random
class random number generating system so that if I use the following
sentence: int ID =3D (new System.Random(234)).Next(100000, 999999); in
later years I will get different value to ID than I get it now.

Please help me with this question, I can't really continue building my
web application until I have got a confident answere to this.

I could aslo use GUID (global identifier) but it is too long for
purposes I use it for. Users wouldn't trouble to type that complex ID
in.

With best hopes and wishes
Priit Raag
-- everyday.com --

| [aspngfw] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngfw.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

| [aspngfw] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngfw.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Steven A Smith (VIP)
To reliably get the same number over and over, I would think that a hash
would be more appropriate. Look into the cryptography namespace to see how
you can generate a hashcode given a value. This will always be the same for
a given value (assuming you stick with the same algorithm - .NET supports
two out of the box, I think).

Steve

----- Original Message -----
From: "Scott" <Click here to reveal e-mail address>
To: "aspngfw" <Click here to reveal e-mail address>
Sent: Saturday, August 25, 2001 1:02 PM
Subject: [aspngfw] RE: System.Random class reliability

One other thought. Guid's wouldn't help you if you need to "randomly"
generate the same number. You will never get the same GUID twice, no
matter what you do.

-----Original Message-----
From: Scott
Sent: Saturday, August 25, 2001 9:53 AM
To: aspngfw
Subject: [aspngfw] RE: System.Random class reliability

If this is a high concern, there are plenty of open-source random
algorithms. You could simply roll-your-own pseudo-random number
generator.

Scott Swigart
3 Leaf Solutions LLC
www.3leafsolutions.com
503-281-9681

-----Original Message-----
From: Thunder Bird" <Click here to reveal e-mail address> [mailto:Click here to reveal e-mail address]

Sent: Saturday, August 25, 2001 2:01 AM
To: aspngfw
Subject: [aspngfw] System.Random class reliability

-- This message, which was originally sent to "aspngarchitecture", has
been moved to "aspngfw" mailing list by the List Master --

I'm using System.Random class to generate ID-s for my cutomers. I aslo
use seeds while creating them to assure that all the ID-s generated are
unique.

Is there a possibility that aspng creators will change System.Random
class random number generating system so that if I use the following
sentence: int ID = (new System.Random(234)).Next(100000, 999999); in
later years I will get different value to ID than I get it now.

Please help me with this question, I can't really continue building my
web application until I have got a confident answere to this.

I could aslo use GUID (global identifier) but it is too long for
purposes I use it for. Users wouldn't trouble to type that complex ID
in.

With best hopes and wishes
Priit Raag
-- everyday.com --

| [aspngfw] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngfw.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngfw] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngfw.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngfw] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngfw.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Random




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification