MySQL 8.4.2
Source Code Documentation
my_rnd.cc File Reference
#include "my_rnd.h"
#include <mysql_com.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include "my_inttypes.h"

Functions

void randominit (struct rand_struct *rand_st, ulong seed1, ulong seed2)
 
double my_rnd (struct rand_struct *rand_st)
 Generate random number. More...
 
int my_rand_buffer (unsigned char *buffer, size_t buffer_size)
 Fill a buffer with random bytes using the SSL library routines. More...
 
double my_rnd_ssl (bool *failed)
 Generate a random number using the OpenSSL supplied random number generator if available. More...
 

Function Documentation

◆ my_rand_buffer()

int my_rand_buffer ( unsigned char *  buffer,
size_t  buffer_size 
)

Fill a buffer with random bytes using the SSL library routines.

Parameters
[out]bufferBuffer to receive the random data
[in]buffer_sizesizeof the the buffer
Return values
1error occurred.
0OK

◆ my_rnd()

double my_rnd ( struct rand_struct rand_st)

Generate random number.

Parameters
[in,out]rand_stStructure used for number generation.
Return values
Generatedpseudo random number.

◆ my_rnd_ssl()

double my_rnd_ssl ( bool *  failed)

Generate a random number using the OpenSSL supplied random number generator if available.

Parameters
[out]failedset to TRUE if the method failed. FALSE if OK.
Return values
Generatedrandom number or 0 if failed is set.

◆ randominit()

void randominit ( struct rand_struct rand_st,
ulong  seed1,
ulong  seed2 
)