ePass1000 C/C++ API Reference Manual Version 2.0

# epas_GenRandom

The epas_GenRandom function returns device generated random data.

    EPAS_STATUS EPAS_API
    epas_GenRandom(
        EPAS_HANDLE hContextHandle,      // [in]
        unsigned long ulFlags,           // [in]
        unsigned char* pucBuffer,        // [in][out]
        unsigned long ulBufferSize       // [in]
    );

#### Requirement

epas_CreateContext, epas_OpenDevice

#### Parameters

hContextHandle
  [in] Handle to device context.
ulFlags
  [in] Reserved for future extension. Must be set to zero.
pucBuffer
  [in][out] Pointer to a buffer that receives the generated random data.
ulBufferSize
  [in] Size of the buffer which pucBuffer parameter points to.

#### Return Values

If the function succeeds, FT_SUCCESS returned.

For a list of all return codes, see Status Return Values.

#### Sample Code

    EPAS_STATUS epsRet;
    EPAS_HANDLE handle;
    .
    .
    .
    unsigned char pRandomBuf[100];
    epsRet = epas_GenRandom(handle,0,pRandomBuf,100);

#### See Also

epas_HashToken, epas_MD5_HMAC