43 lines
1.1 KiB
ReStructuredText
43 lines
1.1 KiB
ReStructuredText
======
|
|
random
|
|
======
|
|
|
|
A pure clojure random library.
|
|
|
|
-----------
|
|
description
|
|
-----------
|
|
|
|
This project is a pure clojure random number library that has goals.
|
|
|
|
#. Written in pure clojure
|
|
#. Functional; a seed should be the input of every functions
|
|
#. Use a very good pseudo random number generator algorithm
|
|
#. Thread Safe
|
|
|
|
|
|
---------
|
|
Algorithm
|
|
---------
|
|
The algorithms are translation of Go's "`math/rand`_" package. It totally
|
|
makes sense to use Go's random number generator has it has been implemented
|
|
by `Ken Thompson`_ and has been used and verified by many talented programmers.
|
|
Hence, we can be sure the algorithm is not totally wrong and has a decent speed.
|
|
|
|
.. _math/rand: https://golang.org/pkg/math/rand/
|
|
.. _Ken Thompson: https://en.wikipedia.org/wiki/Ken_Thompson
|
|
|
|
------------
|
|
performances
|
|
------------
|
|
The performance sucks! The java random number generator is many time faster.
|
|
But, if the bottle of your application is the random number generator... bravo!
|
|
That has never happend to me.
|
|
|
|
|
|
-----
|
|
Usage
|
|
-----
|
|
The usage idea is to generate a *state* from a seed. The seed is an integer
|
|
and the state an atom.
|