mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-25 08:57:55 +00:00
Add system_random and random_bytes for js target
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package rand
|
||||
|
||||
foreign import "odin_env"
|
||||
foreign odin_env {
|
||||
rand :: proc "contextless" () -> f64 ---
|
||||
}
|
||||
|
||||
@(require_results)
|
||||
_system_random :: proc() -> u64 {
|
||||
return u64(rand() * 0x1fffffffffffff)
|
||||
}
|
||||
Reference in New Issue
Block a user