Change algorithm to work on 64-bit integers rather than 32-bit integers internally

This commit is contained in:
gingerBill
2023-08-15 10:53:59 +01:00
parent 904c48b11a
commit d13bed9a0a
4 changed files with 28 additions and 131 deletions
+3 -3
View File
@@ -3,9 +3,9 @@ package rand
import win32 "core:sys/windows"
@(require_results)
_system_random :: proc() -> u32 {
value: u32
status := win32.BCryptGenRandom(nil, ([^]u8)(&value), 4, win32.BCRYPT_USE_SYSTEM_PREFERRED_RNG)
_system_random :: proc() -> u64 {
value: u64
status := win32.BCryptGenRandom(nil, ([^]u8)(&value), size_of(value), win32.BCRYPT_USE_SYSTEM_PREFERRED_RNG)
if status < 0 {
panic("BCryptGenRandom failed")
}