Register for your free account! | Forgot your password?

You last visited: Today at 10:02

  • Please register to post and access all features, it's quick, easy and FREE!


True Random

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 782
True Random

Instead using the System.Random class and such, use a real random generator such as random.org's API.

C#:


If you're interested in other languages:


Actual API:


So why is this better?
This might sum that up.
Quote:
Perhaps you have wondered how predictable machines like computers can generate randomness. In reality, most random numbers used in computer programs are pseudo-random, which means they are generated in a predictable fashion using a mathematical formula. This is fine for many purposes, but it may not be random in the way you expect if you're used to dice rolls and lottery drawings.

RANDOM.ORG offers true random numbers to anyone on the Internet. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs. People use RANDOM.ORG for holding drawings, lotteries and sweepstakes, to drive games and gambling sites, for scientific applications and for art and music. The service has existed since 1998 and was built and is being operated by Mads Haahr of the School of Computer Science and Statistics at Trinity College, Dublin in Ireland.

As of today, RANDOM.ORG has generated 1.15 trillion random bits for the Internet community.


This should also solve all your "thread-safe" random problems.



I don't have a username is offline  
Thanks
1 User
Old 08/10/2012, 14:54   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 762
Received Thanks: 539
Big price to pay for not using System.Random... the price being the time to call that website api...

If you have troubles with the (thread-safe)ness of System.Random, build a wrapper around it and make it thread-safe.


-impulse- is offline  
Thanks
1 User
Old 08/10/2012, 15:15   #3
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,124
Received Thanks: 2,500
Definitely not worth it, System.Random has a good distribution so there isn't anything wrong with it, and as impulse said you can just wrap it to make it thread-safe, calling a website for a random number is ridiculous imo.
Korvacs is offline  
Thanks
1 User
Old 08/10/2012, 20:38   #4
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,877
Agreed with the two posts above, lol.


InfamousNoone is offline  
Thanks
1 User
Old 08/10/2012, 23:25   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
I shall follow the stream known as main.

That and they are absolutely correct. It's about 5-10 lines to code to make a threadsafe wrapper for it and maintain your efficiency versus incredibly expensive alternatives (such as calling a website api or a more thorough random generator used in high level encryption)
pro4never is offline  
Old 08/11/2012, 00:13   #6
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,877
When I need a ts-random I use a light-weight implementation which uses xor to generate values. Take a look at FastRandom's implementation by Collins Green.
InfamousNoone is offline  
Old 08/11/2012, 00:32   #7
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,198
IAmHawtness is offline  
Old 08/11/2012, 00:50   #8
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
Quote:
Originally Posted by I don't have a username View Post
...
Off-topic, but what does your signature mean? What's up with Arco?
_Emme_ is offline  
Old 08/11/2012, 00:56   #9

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,394
Received Thanks: 1,054
Quote:
Originally Posted by pro4never View Post
I shall follow the stream known as main.

That and they are absolutely correct. It's about 5-10 lines to code to make a threadsafe wrapper for it and maintain your efficiency versus incredibly expensive alternatives (such as calling a website api or a more thorough random generator used in high level encryption)
True. There is one in the CO2_CORE_DLL.

And, System.Random is enough random for most use...
CptSky is offline  
Old 08/11/2012, 02:35   #10
 
elite*gold: 0
Join Date: Jan 2006
Posts: 1,055
Received Thanks: 293
bleah.. i clicked this thread excited i would see something new..
Silent-Death is offline  
Old 08/11/2012, 02:38   #11
 
elite*gold: 0
Join Date: Jun 2009
Posts: 602
Received Thanks: 193
Quote:
Originally Posted by EmmeTheCoder View Post
Off-topic, but what does your signature mean? What's up with Arco?
He went to the army*I think*.
diedwarrior is offline  
Old 08/11/2012, 05:07   #12
 
elite*gold: 0
Join Date: Jul 2012
Posts: 34
Received Thanks: 2
Quote:
which means they are generated in a predictable fashion using a mathematical formula
does that include System.Random with time seed ?
anyway i think no one knows mathematical formula of system.random which makes it pretty enough for simple usage but thanks for sharing
Mind Fuck is offline  
Old 08/11/2012, 05:08   #13
 
elite*gold: 0
Join Date: Jul 2012
Posts: 34
Received Thanks: 2
****** connection double posted
Mind Fuck is offline  
Old 08/11/2012, 10:47   #14
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 782
Quote:
Originally Posted by EmmeTheCoder View Post
Off-topic, but what does your signature mean? What's up with Arco?
He went to the airforce lols

Quote:
Originally Posted by Mind **** View Post
does that include System.Random with time seed ?
anyway i think no one knows mathematical formula of system.random which makes it pretty enough for simple usage but thanks for sharing
Yes it does, because the seed is onyl set in the constructor.


I don't have a username is offline  
Reply



« Proxy Library | Inline MSIL in C# and Generic Pointers »

Similar Threads
[SALE] Random ISRO chars in random servers CHEAP, from 1$ to 3$
06/03/2012 - Silkroad Online Trading - 4 Replies
Hello, I want to sell all those chars very cheap for PayPal money from 1$ to 3$ , because I need some money to buy usb joystick to play FIFA on pc ^^ If you buy them all, I can sell all those chars for 15$!!! Contacts - skype: myntex2 I...
True Classic - A True Co Classic PServer
12/23/2011 - CO2 PServer Archive - 53 Replies
Deleted. If you like communism and like being ruled by an unfair dictator. Please go here. www.trueclassic.net otherwise go here www.explicitintentions.net
************** true buddy true BOT for aion
10/09/2009 - Aion Hacks, Bots, Cheats & Exploits - 14 Replies
My friend has Aionbuddy Aion Bot • Index page its the korean bot EVERYONE is talking about but No ONE has but he does its 15 usd a month its expensive yes but watch the short video he made I use this thing and WOWOWOW. Aionbuddy Aion Bot...



All times are GMT +2. The time now is 10:02.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.