Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_random.h File Reference

Cryptographically secure random bytes and hex tokens (POSIX) More...

#include "nilorea/n_str.h"
#include <stddef.h>
+ Include dependency graph for n_random.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int n_random_bytes (unsigned char *buf, size_t n)
 fill buf with n cryptographically secure random bytes (getrandom(2) when available, otherwise /dev/urandom).
 
N_STRn_random_hex_token (size_t nbytes)
 generate nbytes secure random bytes and return them as a lowercase hex N_STR (2*nbytes characters); free with free_nstr.
 

Detailed Description

Cryptographically secure random bytes and hex tokens (POSIX)

Author
Castagnier Mickael
Version
1.0

Definition in file n_random.h.