You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-21Lines changed: 33 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
-
# TrueRandom
1
+
# TrueRandom
2
2
Get true random numbers from [RANDOM.ORG](http://random.org).
3
3
4
-
# Description
4
+
# Description
5
5
Use the true random number service of [RANDOM.ORG](http://random.org). The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs.
6
6
7
7
8
-
#Installation
8
+
#Installation
9
9
##From the command line.
10
10
11
11
```shell
@@ -26,23 +26,23 @@ gem 'true-random'
26
26
bundle install
27
27
```
28
28
29
-
##Important note!
29
+
##Important note!
30
30
To access [RANDOM.ORG](http://random.org) via an automated client, please make sure you observe the [Guidelines for Automated Clients](http://www.random.org/clients/) or your computer may be banned.
31
31
32
-
#Usage
33
-
##Integer Generator
32
+
#Usage
33
+
##Integer Generator
34
34
The Integer Generator will generate truly random integers in configurable intervals.
35
35
36
36
```ruby
37
37
rnd =TrueRandom::Random.new
38
38
puts rnd.integer
39
39
```
40
40
41
-
**Parameters**
42
-
*n* The number of integers requested. 1 by default.
43
-
*min* The smallest value allowed for each integer. 1 by default.
44
-
*max* The largest value allowed for each integer. 100 by default.
45
-
*base* The base that will be used to print the numbers, i.e., binary, octal, decimal or hexadecimal. Possible values are 2, 8, 10 or 16. 10 by default.
41
+
**Parameters**
42
+
*n* The number of integers requested. 1 by default.
43
+
*min* The smallest value allowed for each integer. 1 by default.
44
+
*max* The largest value allowed for each integer. 100 by default.
45
+
*base* The base that will be used to print the numbers, i.e., binary, octal, decimal or hexadecimal. Possible values are 2, 8, 10 or 16. 10 by default.
46
46
47
47
The same example with full parameters
48
48
@@ -59,9 +59,9 @@ The Sequence Generator will randomize a given interval of integers, i.e., arrang
59
59
puts rnd.sequence
60
60
```
61
61
62
-
**Parameters**
63
-
*min* The lower bound of the interval (inclusive). 1 by default.
64
-
*max* The upper bound of the interval (inclusive). 100 by default.
62
+
**Parameters**
63
+
*min* The lower bound of the interval (inclusive). 1 by default.
64
+
*max* The upper bound of the interval (inclusive). 100 by default.
65
65
66
66
The sequence requested must 10,000 numbers or shorter in length, i.e., max-min+1=1e4.
67
67
@@ -73,13 +73,13 @@ The String Generator will generate truly random strings of various length and ch
73
73
puts rnd.string
74
74
```
75
75
76
-
**Parameters**
77
-
*n* The number of strings requested. 1 by default.
78
-
*len* The length of the strings. All the strings produced will have the same length. Max length 20. 20 by default.
79
-
*digits* Determines whether digits (0-9) are allowed to occur in the strings. Possible values are true or false. True by default.
80
-
*upperalpha* Determines whether uppercase alphabetic characters (A-Z) are allowed to occur in the strings. Possible values are true or false. True by default.
81
-
*loweralpha* Determines lowercase alphabetic characters (a-z) are allowed to occur in the strings. Possible values are true or false. True by default.
82
-
*unique* Determines whether the strings picked should be unique (as a series of raffle tickets drawn from a hat) or not (as a series of die rolls). If unique is set to on, then there is the additional constraint that the number of strings requested (num) must be less than or equal to the number of strings that exist with the selected length and characters. Possible values are true or false. True by default.
76
+
**Parameters**
77
+
*n* The number of strings requested. 1 by default.
78
+
*len* The length of the strings. All the strings produced will have the same length. Max length 20. 20 by default.
79
+
*digits* Determines whether digits (0-9) are allowed to occur in the strings. Possible values are true or false. True by default.
80
+
*upperalpha* Determines whether uppercase alphabetic characters (A-Z) are allowed to occur in the strings. Possible values are true or false. True by default.
81
+
*loweralpha* Determines lowercase alphabetic characters (a-z) are allowed to occur in the strings. Possible values are true or false. True by default.
82
+
*unique* Determines whether the strings picked should be unique (as a series of raffle tickets drawn from a hat) or not (as a series of die rolls). If unique is set to on, then there is the additional constraint that the number of strings requested (num) must be less than or equal to the number of strings that exist with the selected length and characters. Possible values are true or false. True by default.
83
83
84
84
##Quota Checker
85
85
The Quota Checker allows you to examine your quota at any point in time. The quota system works on the basis of IP addresses. Each IP address has a base quota of 1,000,000 bits. When your client makes a request for random numbers (or strings, etc.), the server deducts the number of bits it took to satisfy your request from the quota associated with your client's IP address.
@@ -98,3 +98,15 @@ You can request for certain IP.
98
98
99
99
n.n.n.n is the IP address for which you wish to examine the quota. Each value for n should be an integer in the [0,255] interval. This parameter is optional. If you leave it out, it defaults to the IP address of the machine from which you are issuing the request.
s.summary="Get true random numbers from RANDOM.ORG."
15
-
s.description="Use the true random number service of RANDOM.ORG. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs."
s.summary="Get true random numbers from RANDOM.ORG."
15
+
s.description="Use the true random number service of RANDOM.ORG. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs."
0 commit comments