RANDOM.ORG API function library

Summary
RANDOM.ORG API function library
Functions
randomdotorg_integer()It generates truly random integers in configurable intervals.
randomdotorg_string()It generates truly random strings of various length and character compositions.
randomdotorg_password()It generates truly random passwords (6-24 characters long).
randomdotorg_randomizelist()It arranges the items of a list in random order.
randomdotorg_lottery()It allows you to quick pick lottery tickets.
randomdotorg_clocktime()It generates random clock times of the day (or night).
randomdotorg_sequence()It randomizes a given interval of integers, i.e., arranges them in random order.
randomdotorg_decimalfraction()It generates random decimal fractions in the [0,1] interval.
randomdotorg_gaussian()It generates random numbers from a Gaussian distribution (also known as a normal distribution).
randomdotorg_bitmap()It generates random bitmaps.
randomdotorg_noise()It generates random audio noise, i.e., audio files containing perfect white noise.
randomdotorg_quota()It allows you to examine your quota at any point in time.
UsageHow to use this library
AboutAbout the library, about Random.org
LicenseThis library is licensed under the GPL.

Functions

randomdotorg_integer()

randomdotorg_integer(num,  
min,  
max,  
base = "10",
rnd = "new")

It generates truly random integers in configurable intervals.

Parameters

numThe number of integers requested.  Possible values: [1,1e4]
minThe smallest value allowed for each integer.  Possible values: [-1e9,1e9]
maxThe largest value allowed for each integer.  Possible values: [-1e9,1e9]
baseOptional.  The base that will be used to print the numbers, i.e., binary, octal, decimal or hexadecimal.  Default value: 10.  Possible values: 2 | 8 | 10 | 16
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated integers as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

Examples

MsgBox, % randomdotorg_integer(10,0,9999)
MsgBox, % randomdotorg_integer(5,111111,121212,10,"date.2010-01-01")
MsgBox, % randomdotorg_integer(1,-555,555)
MsgBox, % randomdotorg_integer(1,0,10,2)

randomdotorg_string()

randomdotorg_string(num,  
len,  
digits = true,
upperalpha = true,
loweralpha = true,
unique = true,
rnd = "new")

It generates truly random strings of various length and character compositions.

Parameters

numThe number of strings requested.  Possible values: [1,1e4]
lenThe length of the strings.  All the strings produced will have the same length.  Possible values: [1,20]
digitsOptional.  Determines whether digits (0-9) are allowed to occur in the strings.  Default value: true.  Possible values: true | false
upperalphaOptional.  Determines whether uppercase alphabetic characters (A-Z) are allowed to occur in the strings.  Default value: true.  Possible values: true | false
loweralphaOptional.  Determines whether lowercase alphabetic characters (a-z) are allowed to occur in the strings.  Default value: true.  Possible values: true | false
uniqueOptional.  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.  Default value: true.  Possible values: true | false
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated strings as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

Examples

;This one generates ten unique strings. Each string is 15 characters long,
;and contains lower- and uppercase letters and numbers:
MsgBox, % randomdotorg_string(10,15)


;This one generates five strings. Each string is 12 characters long,
;and consists of lowercase letters and numbers, and the strings may be identical:
MsgBox, % randomdotorg_string(5,12,true,false,true,false)

randomdotorg_password()

randomdotorg_password(num,  
len,  
rnd = "new")

It generates truly random passwords (6-24 characters long).

Parameters

numThe number of passwords requested.  Possible values: [1,100]
lenThe length of passwords (in characters).  Possible values: [6,24]
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated passwords as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

About security

The passwords are transmitted securely (via SSL) and are not stored on the RANDOM.ORG server.  Nevertheless, the best data security practice is not to let anyone but yourself generate your most important passwords.  So, feel free to use these passwords for your wi-fi encryption or for that extra Gmail account, but you shouldn’t use any online service to generate passwords for highly sensitive things, such as your online bank account.

Examples

MsgBox, % randomdotorg_password(10,20)
MsgBox, % randomdotorg_password(10,6)

randomdotorg_randomizelist()

randomdotorg_randomizelist(list,  
rnd = "new")

It arranges the items of a list in random order.

Parameters

listA list of items to randomize.  The items must be separated by linebreaks (`r`n).
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Randomized list, items separated with linebreaks.
  • Error: The string “Error:” followed by a string with further details.

Remarks

  • rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

  • linebreaks:

All three types of linebreak can be used: “`r” amd “`n” and “`r`n”.  After the randomization the result list will have the same linebreaks as the input list.

Examples

;This one loads the content of a file, randomizes it and displays the randomized list via MsgBox.
;(Note: The file must exist and must contain a valid list of items separated by linebreaks for this example to work.)
FileRead, _list, c:\list.txt
Msgbox, % randomdotorg_randomizelist(_list)


;This one randomizes the list content of a variable.
_list := "item1`nitem2`nitem3`nitem4`n"  ;the content of the _list variable is a list with 4 items, separated by linebreaks (`n)
_list := randomdotorg_randomizelist(_list)


;This one is the same as the second example.
_list=
(
item1
item2
item3
item4
)
_list := randomdotorg_randomizelist(_list)

randomdotorg_lottery()

randomdotorg_lottery(tickets,  
num_main,  
highest_main,  
num_bonus = "0",
highest_bonus = "0")

It allows you to quick pick lottery tickets.

Parameters

ticketsThe number of tickets to pick.  Possible values: [1,100]
num_mainIt specifies how many numbers are drawn.  (Eg.: if you have to select 6 numbers from 1-49 then num_main is 6).  Possible values: [1,99]
highest_mainThe highest number you can draw.  (Eg.: if you have to select 6 numbers from 1-49 then highest_main is 49).  Possible values: [1,99]
num_bonusOptional.  It specifies how many bonus numbers are drawn.  Default value: 0 (no bonus number is drawn).  Possible values: [1,99]
highest_bonusOptional.  The highest bonus number you can draw.  Default value: 0 (no bonus number is drawn).  Possible values: [1,99]

Returns

  • Success: Generated tickets as comma separated items (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

If you have to select 6 numbers from 1-49 and 1 bonus number from 1-20 then: num_main is 6, highest_main is 49, num_bonus is 1, highest_bonus is 20.

Examples

MsgBox, % randomdotorg_lottery(5,6,59) ;five tickets for a game where 6 numbers are drawn from 1-59
MsgBox, % randomdotorg_lottery(5,6,59,1,20) ;same as above, only with an additional bonus number from 1-20

randomdotorg_clocktime()

randomdotorg_clocktime(num,  
earliest = "00:00",
latest = "23:59",
interval = "5",
rnd = "new")

It generates random clock times of the day (or night).

Parameters

numThe number of clock times requested.  Possible values: [1,100]
earliestOptional.  The earliest time allowed for the generated clock times, in the format of nn:nn.  Default value: “00:00”.  For further info see: Remarks.
latestOptional.  The latest time allowed for the generated clock times, in the format of nn:nn.  Default value: “23:59”.  For further info see: Remarks.
intervalOptional.  Intervals between the generated clock times, in minutes.  Default value: 5.  Possible values: 1 | 2 | 5 | 10 | 15 | 20 | 30 | 60.  For further info see: Remarks.
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated clock times as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

  • rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

  • earliest, latest, interval:

Each clock time will be generated between the earliest time and the latest time with intervals specified in the interval parameter.  (Limits for earliest and latest are: 00:00 and 23:59; both inclusive).  Eg.: Wrong usage: earliest is “00:00” latest is “00:01” interval is “5”.  In this case no clock times can be generated.  The difference between the earliest and the latest time should be at least 5 minutes to generate one clock time.  Proper usage: earliest is “00:00” latest is “11:00” interval is “60”.  This will successfully generate at least 12 clock times, because the difference between 00:00 and 11:00 is 12 hours (12 x 60 minutes).

Examples

MsgBox, % randomdotorg_clocktimes(10)
MsgBox, % randomdotorg_clocktimes(10,"11:12","23:00")
MsgBox, % randomdotorg_clocktimes(10,"11:12","23:00",30)

randomdotorg_sequence()

randomdotorg_sequence(min,  
max,  
rnd = "new")

It randomizes a given interval of integers, i.e., arranges them in random order.

Parameters

minThe lower bound of the interval (inclusive).  Possible values: [-1e9,1e9]
maxThe upper bound of the interval (inclusive).  Possible values: [-1e9,1e9]
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated integers as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

Examples

MsgBox, % randomdotorg_sequence(1,144)
MsgBox, % randomdotorg_sequence(-10,20)
MsgBox, % randomdotorg_sequence(-10,20,"date.2010-01-01")

randomdotorg_decimalfraction()

randomdotorg_decimalfraction(num,  
dec = 10,
rnd = "new")

It generates random decimal fractions in the [0,1] interval.

Parameters

numThe number of random decimal fractions to generate from a uniform distribution across the [0,1] interval.  Possible values: [1,1e4].
decOptional.  The number of decimal places to use.  Default value: 10.  Possible values: [1,20].
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated decimal fractions as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

Examples

MsgBox, % randomdotorg_decimalfraction(10)
MsgBox, % randomdotorg_decimalfraction(10,2)

randomdotorg_gaussian()

randomdotorg_gaussian(num,  
mean = "0.0",
stdev = "1.0",
dec = 10,
rnd = "new")

It generates random numbers from a Gaussian distribution (also known as a normal distribution).

Parameters

numThe number of strings requested.  Possible values: [1,100]
meanOptional.  Mean.  Default value: 0.0.  Possible values: [-1e6,1e6]
stdevOptional.  Standard deviation.  Default value: 1.0.  Possible values: [-1e6,1e6]
decOptional.  Number of significant digits.  Default value: 10.  Possible values: [2,20]
rndOptional.  Default value: “new”.  Possible values: new | id.identifier | date.iso-date.  For further info see: Remarks.

Returns

  • Success: Generated numbers as comma separated values (CSV)
  • Error: The string “Error:” followed by a string with further details.

Remarks

rnd:

Determines the randomization to use to generate the numbers.  If new is specified, then a new randomization will created from the truly random bitstream at RANDOM.ORG.  This is probably what you want in most cases.  If id.identifier is specified, the identifier is used to determine the randomization in a deterministic fashion from a large pool of pregenerated random bits.  Because the numbers are produced in a deterministic fashion, specifying an id basically uses RANDOM.ORG as a pseudo-random number generator.  The third (date.iso-date) form is similar to the second; it allows the randomization to be based on one of the daily pregenerated files.  This form must refer to one of the dates for which files exist, so it must be the current day (according to UTC) or a day in the past.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings today or yesterday.

Examples

MsgBox, % randomdotorg_gaussian(5)

randomdotorg_bitmap()

randomdotorg_bitmap(save_path = "",
format = "gif",
width = 64,
height = 64,
zoom = 1)

It generates random bitmaps.  (BETA)

Parameters

save_pathOptional.  If you specify this parameter, the random image will be saved to your hard disk at the specified save_path, rather than being returned as hex data.  You must specify a full absolute path including file name.  For further info see: Returns, Remarks, Examples.
formatOptional.  The format of the generated image.  Default value: “gif”.  Possible values: “gif” | “png”.
widthOptional.  Width of the generated image.  Default value: 64.  Possible values: [1,300].  For further info see: Remarks.
heightOptional.  Height of the generated image.  Default value: 64.  Possible values: [1,300].  For further info see: Remarks.
zoomOptional.  Zoom factor.  Default value: 1.  Possible values: [1,4].  For further info see: Remarks.

Returns

  • Success: If the save_path parameter isn’t specified (left blank: “”): The function will return the generated random image as hex data.  If the save_path paraneter is specified: The function will return true/false values indicating if the saving process was successful.
  • Error: The string “Error:” will be returned followed by a string with further details.  (Only if the query to RANDOM.ORG wasn’t successful.)

Remarks

The final image resolution will be (w × z) by (h × z) where w is the width, h is the height and z is the zoom factor.  If you want to save the generated random image to the hard disk, specify a full path in the save_path parameter, eg.

randomdotorg_bitmap("c:\random\images\random1.gif") ;This'll work.

or

randomdotorg_bitmap("f:\random-image.png","png") ;This'll work.

depending on the format defined in the format parameter (gif by default).  If the specified path doesn’t include a file name, the function will not be able to save the image, and will return False eg.: Wrong usage:

randomdotorg_bitmap("c:\images") ;This WON'T work.

If you leave the save_path parameter blank, eg.:

randomdotorg_bitmap() ;This'll work.

or

randomdotorg_bitmap("",png) ;This'll work.

etc., the function will return the image converted into hex data.  This way you can store the image in text files, include in scripts, and so on.  You can also write the image to hard disk yourself, but before you can do that, the hex data must be converted back into binary.  For the binary<->hex conversion and the binary file writing you can use PhiLho’s scripts: http://www.autohotkey.com/forum/viewtopic.php?t=7549 . Here’s a small example script for this scenario: http://autohotkey.net/~gahks/_randomdotorg_bitmap_EXAMPLE.zip

Examples

; This example generates a 64x64 random image in gif format (default parameters), saves it as "c:\random.gif",
; and displays "Successful!", if saving the image was successful, or "Error!", if the the generation or saving process failed.
_var:=randomdotorg_bitmap("c:\random.gif")
if (_var && !InStr(_var,"Error:"))
   MsgBox, Successful!
else
   MsgBox, Error!


; This example generates a 100x100 random image with a zoom value of 2 (see Remarks) in png format,
; returns the image converted into hex data, and displays it in an Edit control.
_var:=randomdotorg_bitmap("","png",100,100,2)
if (_var && !InStr(_var,"Error:")) {
gui, add, edit, w300 h300, % _var
gui, show,, Image data in hex format!
return
}
else
   MsgBox, Error!
GuiClose:
ExitApp

; A full working version of the second example (the hex data is converted back to binary
; and written out to an image file) can be downloaded here:
; http://autohotkey.net/~gahks/_randomdotorg_bitmap_EXAMPLE.zip

randomdotorg_noise()

randomdotorg_noise(save_path = "",
format = "wav",
volume = 100,
channels = "stereo",
rate = 16000,
size = 8,
date = "today")

It generates random audio noise, i.e., audio files containing perfect white noise.  (Detailed description in Remarks.)

Parameters

save_pathOptional.  If you specify this parameter, the generated noise will be saved to your hard disk at the specified save_path, rather than being returned as hex data.  You must specify a full absolute path including file name.  For further info see: Returns, Remarks, Examples.
formatOptional.  Audio format of the generated noise.  Default value: “wav”.  Possible values: “wav” | “aiff” | “au”.
volumeOptional.  Volume of the generated noise in percent.  Default value: 100.  Possible values: 100 | 80 | 60 | 40 | 20.
channelsOptional.  Channel type (mono/stereo).  Default value: “stereo”.  Possible values: “mono” | “stereo”.
rateOptional.  Sample rate.  Default value: 16000.  Possible values: 8000 | 16000 | 32000 | 44100.
sizeOptional.  Sample size (bits per sample).  Default value: 8.  Possible values: 8 | 16.
dateOptional.  Randomness generated on “date” will be used to generate random noise.  The date must be in ISO 8601 format (i.e., YYYY-MM-DD) or one of the two shorthand strings “today” or “yesterday”.  Default value: “today”.  Possible values: “today” | “yesterday” | YYYY-MM-DD.

Returns

  • Success: If the save_path parameter isn’t specified (left blank: “”): The function will return the generated random noise as hex data.  If the save_path paraneter is specified: The function will return true/false values indicating if the saving process was successful.
  • Error: The string “Error:” will be returned followed by a string with further details.  (Only if the query to RANDOM.ORG wasn’t successful.)

Remarks

Detailed description of random noise generator: http://www.random.org/audio-noise/description/ For more info on the save_path parameter, and the return values and useage of this function see the Returns,Remarks,Examples sections of the function randomdotorg_bitmap().

Examples

; This example generates a random noise of 16000 bits per second sample rate, 8 bits per sample sample size,
; with 100% volume and stereo channels in wav format based on the randomness generated today. (Default parameters),
; saves the generated noise as "c:\random.wav", and displays the message "Successful!", if saving the image was successful,
; or "Error!", if the the generation or saving process failed.
_var:=randomdotorg_noise("c:\noise.wav")
if (_var && !InStr(_var,"Error:"))
   MsgBox, Successful!
else
   MsgBox, Error!


; This example generates a random noise of 44100 bits per second sample rate, 16 bits per sample sample size,
; with 80% volume and mono channels in aiff format based on the randomness generated on 2010-01-01,
; returns the noise in hex data format, and displays the first 500 chars in an Edit control.
_var:=randomdotorg_noise("","aiff",80,"mono",44100,16,"2010-01-01")
if (_var && !InStr(_var,"Error:")) {
gui, add, edit, w300 h300, % SubStr(_var,1,500)
gui, show,, Audio data in hex format!
return
}
else
   MsgBox, Error!
GuiClose:
ExitApp

; For an example on what to do with the hex data, see the Remarks and Examples section of randomdotorg_bitmap().

randomdotorg_quota()

randomdotorg_quota(ip = "")

It allows you to examine your quota at any point in time.  For further info see: Remarks.

Parameters

ipOptional.  Default value: “” (blank).  Possible values: “n.n.n.n”.  The IP address for which you wish to examine the quota.  Each value for n should be an integer in the [0,255] interval.  If you leave it out, it defaults to the IP address of the machine from which you are issuing the request.

Returns

  • Success: The qutoa associated with the specified IP address.
  • Error: The string “Error:” followed by a string with further details.

Remarks

The quota system works on the basis of IP addresses.  Each IP address has a base quota of 1,000,000 bits.  When you make 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.  If your client issues a request for random numbers while its quota is negative, the RANDOM.ORG server will return a 503 error response.  Every day, shortly after midnight UTC, all quotas with less than 1,000,000 bits receive a free top-up of 200,000 bits.

Examples

MsgBox, % randomdotorg_quota()
MsgBox, % randomdotorg_quota("134.226.36.80")

Usage

How to use this library

Downloads

randomdotorg.zipContains the library and all the dependencies (httpQuery.ahk, BinHexConvert.ahk, write_bin.ahk), and the documentation.  Recommended.
randomdotorg.ahkThe library and the scripts the library depends on all merged together in one file.

http://autohotkey.net/~gahks/randomdotorg.zip

http://autohotkey.net/~gahks/randomdotorg.ahk

Which one to use

The first version (randomdotorg.zip) is recommended: Every script is a separate file, and the library uses #Include to include them on runtime.

How to use this library

There are two ways to use this library:

  • You can use the #Include command to include randomdotorg.ahk in your script, or
  • You can copy it to your Autohotkey\Lib dir, so you won’t have to include it every time you want to use one of these functions.

To use it as a standard library

1. Download randomdotorg.zip from http://autohotkey.net/~gahks/randomdotorg.zip
2. Go to your Autohotkey dir. Create a dir named "Lib" if there isn't already one. Extract randomdotorg.zip to the Lib dir.
3. Use the functions in any script.

To use the #Include command

1. Download randomdotorg.zip from http://autohotkey.net/~gahks/randomdotorg.zip
2. Extract its content (all the files - except the html - must be exrtacted to one place).
3. Include randomdotorg.ahk via #Include in your script. Use the functions.

About

About the library, about Random.org

About the library

Namerandomdotorg.ahk
Version0.3
DependencieshttpQuery.ahk, write_bin.ahk, Bin2Hex() (found in BinHexConvert.ahk)
Date2010-06-04
Authorgahks
Homepagehttp://autohotkey.net/~gahks/
Forum topichttp://www.autohotkey.com/forum/topic58785.html

About RANDOM.ORG

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.  For further info check out: http://www.random.org/

You can learn more about randomness at http://www.random.org/randomness/.

If you’re gonna implement one or more of these functions to your script, you’ll want to read the guidelines for automated clients at http://www.random.org/clients/.

TODO

Add more functions...  Specifically:

The Arts: Jazz Scales
Miscellany: Calendar Dates

Thanks

Thanks to Chris for AHK, Heresy & derRaphael for httpQuery() and write_bin(), PhiLho for all the hex and bin stuff and the owner(s) of RANDOM.org for the service, the creator of NaturalDocs and majkinetor for the NaturalDocs installer.

License

This library is licensed under the GPL.

randomdotorg_integer(num,  
min,  
max,  
base = "10",
rnd = "new")
It generates truly random integers in configurable intervals.
randomdotorg_string(num,  
len,  
digits = true,
upperalpha = true,
loweralpha = true,
unique = true,
rnd = "new")
It generates truly random strings of various length and character compositions.
randomdotorg_password(num,  
len,  
rnd = "new")
It generates truly random passwords (6-24 characters long).
randomdotorg_randomizelist(list,  
rnd = "new")
It arranges the items of a list in random order.
randomdotorg_lottery(tickets,  
num_main,  
highest_main,  
num_bonus = "0",
highest_bonus = "0")
It allows you to quick pick lottery tickets.
randomdotorg_clocktime(num,  
earliest = "00:00",
latest = "23:59",
interval = "5",
rnd = "new")
It generates random clock times of the day (or night).
randomdotorg_sequence(min,  
max,  
rnd = "new")
It randomizes a given interval of integers, i.e., arranges them in random order.
randomdotorg_decimalfraction(num,  
dec = 10,
rnd = "new")
It generates random decimal fractions in the [0,1] interval.
randomdotorg_gaussian(num,  
mean = "0.0",
stdev = "1.0",
dec = 10,
rnd = "new")
It generates random numbers from a Gaussian distribution (also known as a normal distribution).
randomdotorg_bitmap(save_path = "",
format = "gif",
width = 64,
height = 64,
zoom = 1)
It generates random bitmaps.
randomdotorg_noise(save_path = "",
format = "wav",
volume = 100,
channels = "stereo",
rate = 16000,
size = 8,
date = "today")
It generates random audio noise, i.e., audio files containing perfect white noise.
randomdotorg_quota(ip = "")
It allows you to examine your quota at any point in time.
Close