What sources can produce random data
Here are some. What are some other?
* timing of radioactive decays
* recording background noise into .wav files
* live video files
* session logs from chat 开发者_开发百科lines
* keystroke latencies for typed text
- Mouse movements
- Soil moisture
- Number of ants passing through a point in an antfarm.
- Checksum/hash of data from the frontpage of a very dynamic website (like twitter).
The nice random.org site by Mads Haahr has been providing hardware RNG draws via a web interface for many years.
My random package for R uses this:
R> library(random)
R> rn <- randomNumbers(100, 1, 100, 5)
R> head(rn)
V1 V2 V3 V4 V5
[1,] 96 99 68 95 90
[2,] 84 11 62 20 40
[3,] 83 79 38 32 90
[4,] 28 18 32 58 97
[5,] 15 31 42 68 98
[6,] 65 93 6 15 55
R> rs <- randomSequence(1, 20)
R> head(rs)
V1
[1,] 14
[2,] 4
[3,] 6
[4,] 11
[5,] 13
[6,] 20
R>
There is ample documentation in an introduction by Mads which I include with the package
JavaScript creates its "random" numbers from an internal clock in milliseconds, which is quite random. Other sources may include atmospheric pressure and public keys.
http://en.wikipedia.org/wiki/Hardware_random_number_generator
In short - best random sources are such those roots are based on laws of quantum mechanics or chaos theory.
精彩评论