BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlb::RandomDevice Struct Reference

#include <bdlb_randomdevice.h>

Public Types

typedef bsls::Types::size_type size_t
 

Static Public Member Functions

static int getRandomBytes (unsigned char *buffer, size_t numBytes)
 
static int getRandomBytesNonBlocking (unsigned char *buffer, size_t numBytes)
 

Detailed Description

This struct provides a namespace for a suite of functions used for acquiring random numbers from the system.

Member Typedef Documentation

◆ size_t

Member Function Documentation

◆ getRandomBytes()

static int bdlb::RandomDevice::getRandomBytes ( unsigned char *  buffer,
size_t  numBytes 
)
static

Read the specified numBytes from the system random number generator into the specified buffer. Returns 0 on success, non-zero otherwise. Note that this method may block if called repeatedly or if numBytes is high.

◆ getRandomBytesNonBlocking()

static int bdlb::RandomDevice::getRandomBytesNonBlocking ( unsigned char *  buffer,
size_t  numBytes 
)
static

Read the specified numBytes from the system non-blocking random number generator into the specified buffer. Returns 0 on success, non-zero otherwise. Note that the cryptographic strength of samples drawn from this pool may or may not be lower than that of those drawn from the blocking pool, and may vary by platform.


The documentation for this struct was generated from the following file: