set_random_source
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | set_random_source [2006/09/19 03:45] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Synopsis: | ||
+ | [[set]] random_source [< | ||
+ | |||
+ | ======Description: | ||
+ | The [[rand]]om function generates random numbers. | ||
+ | number? | ||
+ | |||
+ | | Entropy | Given a set of the last <N> random numbers, how likely is it you can guess the next random number? (High entropy means less guessability) | | ||
+ | | Distribution | Given a set of the last <N> random numbers, how likely is it each of the possible values of <N> have appeared the same number of times? (High distribution means every value is hit the same number of times) | | ||
+ | | Repeatability | Given a set of the first <N> random numbers, how likely is it that you can create the same <N> random numbers again? (High repeatability means you can regenerate the same sequence upon request) | | ||
+ | |||
+ | A discussion of the pros and cons of each of these attributes is beyond | ||
+ | the scope of this document. | ||
+ | |||
+ | ^ Value ^ Description ^ Entropy ^ Distribution ^ Repeatability ^ | ||
+ | | 0 | Reads from / | ||
+ | | 1 | Traditional ircII PRNG | Low | High | Yes | | ||
+ | | 2 | gettimeofday() calls | Medium | Low | No | | ||
+ | | 3 | arc4random PRNG | High | Medium | No | | ||
+ | |||
+ | The factory default value is 0. Although you can [[set]] the value to | ||
+ | other than 0, 1, 2, or 3, any other values are treated as though you had | ||
+ | set it to 3. If / | ||
+ | you had set it to 1. | ||
+ | |||
+ | The random number generator is used by [[rand]] and [[randread]] | ||
+ | |||
+ | ======History: | ||
+ | The [[set random_source]] variable first appeared in EPIC4pre2.001-NR13. | ||
+ | Arc4random support (set random_source 3) first appeared in EPIC4-1.1.8. | ||
+ | |||
+ | #$EPIC: set_random_source.txt, | ||
set_random_source.txt · Last modified: 2006/09/19 03:45 by 127.0.0.1