Include dependency graph for random.c:
Go to the source code of this file.
|Initalizes the random number generator, or opens access to an existing one. |
|Obtains a random number. |
|Uninitalizes the random number generator. |
|static FILE *||urand = NULL|
|A file handle used to access a random number device run by the operating system. |
Copyright (C) 2007 Jeff Jackowski
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Or visit their website at: http://www.gnu.org/
Definition in file random.c.
Initalizes the random number generator, or opens access to an existing one.
On non-Windows systems, this will attempt to open /dev/urandom. If it cannot be opened or if the program is compiled on Windows, it will fallback on the ANSI C pseudo random number generator.
Obtains a random number.
If the ANSI C pseudo random number generator is being used, it will be called twice and place the first result in the upper 16-bits, and the second result in the lower 16-bits. This will normally result in 30-bits of random data. If /dev/urandom is being used, 4 bytes will be read and placed in the integer for 32-bits of randomness.
|FILE* urand = NULL