mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Change algorithm to work on 64-bit integers rather than 32-bit integers internally
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user