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.
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.
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)
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.
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...
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
Off-topic, but what does your signature mean? What's up with Arco?
He went to the airforce lols
Quote:
Originally Posted by Mind ****
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.
[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 ACCEPT PAYPAL ONLY
So let's start:
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 • Index page and you can msn him and email him to buy it =)