Random number/string functions. More...
#include "config.h"#include <errno.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include <sys/types.h>#include "random.h"#include "exit.h"#include "file.h"#include "logging2.h"#include "message.h"
Include dependency graph for random.c:Go to the source code of this file.
Functions | |
| static int | mutt_randbuf (void *buf, size_t buflen) |
| Fill a buffer with randomness. | |
| void | mutt_rand_base32 (char *buf, size_t buflen) |
| Fill a buffer with a base32-encoded random string. | |
| uint64_t | mutt_rand64 (void) |
| Create a 64-bit random number. | |
Variables | |
| static FILE * | FpRandom = NULL |
| FILE pointer of the random source. | |
| static const unsigned char | Base32 [] = "abcdefghijklmnopqrstuvwxyz234567" |
| Base 32 alphabet. | |
Random number/string functions.
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, see http://www.gnu.org/licenses/.
Definition in file random.c.
|
static |
Fill a buffer with randomness.
| buf | Buffer for result |
| buflen | Size of buffer |
| 0 | Success |
| -1 | Error |
Definition at line 58 of file random.c.
Here is the caller graph for this function:| void mutt_rand_base32 | ( | char * | buf, |
| size_t | buflen ) |
Fill a buffer with a base32-encoded random string.
| buf | Buffer for result |
| buflen | Length of buffer |
Definition at line 106 of file random.c.
Here is the call graph for this function:
Here is the caller graph for this function:| uint64_t mutt_rand64 | ( | void | ) |
|
static |