Skip to content

Commit 69a6844

Browse files
committed
win rng
1 parent f404558 commit 69a6844

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,18 @@ nodevrandom:
676676
}
677677
```
678678
679-
On Windows systems, [CryptGenRandom](http://msdn.microsoft.com/en-us/library/aa379942.aspx) from the Win32 API provides cryptographically secure pseudorandom bytes. Microsoft provides the following usage example:
679+
On recent Windows platforms, [BCryptGenRandom](https://docs.microsoft.com/en-us/windows/desktop/api/bcrypt/nf-bcrypt-bcryptgenrandom) (nothing to do with the password hash bcrypt) should be used to generate cryptographically secure data. Its interface is straightforward:
680+
681+
```C
682+
NTSTATUS BCryptGenRandom(
683+
BCRYPT_ALG_HANDLE hAlgorithm,
684+
PUCHAR pbBuffer,
685+
ULONG cbBuffer,
686+
ULONG dwFlags
687+
);
688+
```
689+
690+
On legacy Windows platforms, [CryptGenRandom](http://msdn.microsoft.com/en-us/library/aa379942.aspx) from the legacy Win32 CryptoAPI provides cryptographically secure pseudorandom bytes. Microsoft provides the following usage example:
680691

681692
```C
682693
#include <stddef.h>

0 commit comments

Comments
 (0)