diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2023-10-31 12:16:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-31 12:16:25 +0000 |
| commit | eb261f5b28a8d3cddc3dc21441f33775bb3ced95 (patch) | |
| tree | 55014f5e1ffe0c099376699945a1800cc4d16246 /core/math | |
| parent | bbd4c1054e18f18e934828b5160efce076027d1e (diff) | |
| parent | f5febb633c92ee1cf7b5d88f0146ffac3e2481b7 (diff) | |
Merge branch 'master' into new-sys-unix
Diffstat (limited to 'core/math')
| -rw-r--r-- | core/math/rand/system_js.odin | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/math/rand/system_js.odin b/core/math/rand/system_js.odin new file mode 100644 index 000000000..b9b71c4a6 --- /dev/null +++ b/core/math/rand/system_js.odin @@ -0,0 +1,14 @@ +package rand + +foreign import "odin_env" +foreign odin_env { + @(link_name = "rand_bytes") + env_rand_bytes :: proc "contextless" (buf: []byte) --- +} + +@(require_results) +_system_random :: proc() -> u64 { + buf: [8]u8 + env_rand_bytes(buf[:]) + return transmute(u64)buf +} |