 |
CryptGenRandom ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Fills a buffer with cryptographically random bytes. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOL WINAPI CryptGenRandom(
HCRYPTPROV hProv,
DWORD dwLen,
BYTE* pbBuffer
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER CryptGenRandom IN advapi32;
INTEGER hProv,;
LONG dwLen,;
STRING @pbBuffer
|
 |
 |
 |
| Parameters: |
 |
hProv
[in] Handle of a cryptographic service provider (CSP) created by a call to CryptAcquireContext.
dwLen
[in] Number of bytes of random data to be generated.
pbBuffer
[in, out] Buffer to receive the returned data. |
 |
 |
| Return value: |
 |
| If the function succeeds, the return value is nonzero (TRUE). |
 |
 |
| My comment: |
 |
| The data produced by this function is cryptographically random. It is far more random than the data generated by the typical random number generator such as the one shipped with your C compiler. |
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2006-05-04 19:29:16 | | Modified: | 2006-05-04 19:31:47 | Visited in last 7 days: 15 |