Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Random generator via atmospheric noise
branch: master
Failed to load latest commit information.
doc Fixed readme, fixed travis
src/randomorg Tests are done
test/randomorg Fixed keyword
.gitignore Emacs gitignore
.travis.yml Kibit checks fixed
LICENSE Initial commit Readme upd
project.clj Kibit checks fixed


Build Status Dependencies Status

Random generator via atmospheric noise

[randomorg "0.1.0"]


Are your random numbers really random?


;; generate two 6-sided dice rolls
(generate-integers :n 2 :min 1 :max 6)

;; shuffle 52-card deck
(generate-integers :n 52 :min 1 :max 52 :replacement false)

;; uniform distribution of 10 numbers in [0, 1]
(generate-decimal-fractions :n 10 :digits 2)

;; normal distribution
(generate-gaussians :n 10 :mean 0 :std 10 :digits 2)

;; new password alphanumeric 12 chars
(generate-strings :n 1 :length 12 :characters (str lowercase uppercase digits))

;; three UUIDs
(generate-uuids :n 3)

;; 1Kb of random garbage
(generate-blobs :n 1 :size (* 8 1024) :format "hex")

All request are made with default API key, which is shared. Request your own API key for production purposes.

(binding [*API_KEY* "your-api-key"]
  (generate-integers :n 10 :min 0 :max 99))

Digital Signing provides signed version of its API. Just add an optional parameter :signed true

(generate-uuids :n 1 :signed true)

Response map contains additional object :signed

{:signed {:random { <random data> }
          :signature "SHA512-json-random"}}

Using this object you can validate that results are really random and comes from Encode random object to json, compute SHA-512 and verify against signature. Also, you can use api call for that.

(verify-signature {:random { <random data> }
                   :signature "SHA512-json-random"})

Remaining quota

Every succesful response return :usage object as well

{:requests-left 4978
 :bits-left     482078}

Besides, you can request quota without data


It includes total usage of API_KEY as well.

{:requests-left   4978
 :bits-left       482078
 :total-bits      26347262
 :total-requests  237}


To avoid wasteful calls with invalid params to server, we use bouncer validation library. It contains plenty checks if all required parameters specified, values in a allowed range, etc.

If validation error occurs, error object returned

{:status :error :message "n must be provided"}


Currently all tests are dumb - they validate that request is actually sent to and response is returned. There are no validation of content obtained from Tests are powered by midje

lein midje

Static Analysis

  • lein eastwood
  • lein kibit


Distributed under the Eclipse Public License.

Something went wrong with that request. Please try again.