Source

hasard /

Filename Size Date modified Message
cmake
doc
examples
lib
python
tests
tools
weak
107 B
1.1 KB
1.1 KB
8.0 KB
1.8 KB
1.7 KB
1.8 KB
1.9 KB
4.2 KB
173 B
171 B
3.9 KB
2.9 KB
116 B
++++++++++++++
Hasard library
++++++++++++++

Hasard
======

Hasard is a pseudo-random number generator (PRNG) library. It includes multiple
engines (algorithms), examples: Arcfour, Mersenne Twister and Linux /dev/random
device. It hides internal details to give a simple API. You don't choose
directly the engine but a profile like "@fast" or "@secure": Hasard chooses the
best engine and the best seed. The code is tested by unit tests.

Hasard works on Linux, FreeBSD and Windows and is distributed under BSD
license. The library is written in C. A Python binding is also available.

The word "hasard" is the french name of "randomness".

Website: http://bitbucket.org/haypo/hasard/


Features
========

Easy
----

 * Simple API with high level functions and uniform distribution
 * Generic functions to get/set generator seed and state, or to reseed the
   generator
 * Reuse existing libraries: OpenSSL, gcrypt, GSL, GMP, glib, etc.
 * Informations about the generator: name, min/max period, tick range, etc.

Safe
----

 * Choose the best generator for your needs and your environment (Linux,
   Windows, FreeBSD, etc.) using "profiles" (eg. "@fast" or "@secure")
 * Automatically seed the engine using good quality entropy
 * Thread safe: reentrant functions, support lock callbacks
 * Reseed the engine at fork()

Tests
-----

 * Include many unit tests
 * Reuse existing PRNG test programs like dieharder or ENT


Documentation
=============

See "doc/" subdirectory.

See doc/engine_list.rst to get the list of all Hasard engines.


Library goals
=============

 * Simple API
 * Avoid common errors: poor seed (time/pid), biais in number generation (eg.
   rand()%10), etc.
 * Be used by all open source projects: distributed under a BSD license
 * Well tested library: unit tests, regression tests, entropy tests, ...