Search:
Namespaces
Discussions
.NET v1.1
Feedback
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
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com