Thread safe random functions. More...
|Max random value. More...|
|void||ub_randfree (struct ub_randstate *s)|
|Delete the random state. More...|
Thread safe random functions.
Similar to arc4random() with an explicit initialisation routine.
The code in this file is based on arc4random from openssh-4.0p1/openbsd-compat/bsd-arc4random.c That code is also BSD licensed. Here is their statement:
Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|#define MAX_VALUE 0x7fffffff|
Max random value.
Similar to RAND_MAX, but more portable (mingw uses only 15 bits random).