mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-02 11:12:31 +00:00
16 lines
268 B
Odin
16 lines
268 B
Odin
#+build freebsd, openbsd, netbsd
|
|
package crypto
|
|
|
|
foreign import libc "system:c"
|
|
|
|
HAS_RAND_BYTES :: true
|
|
|
|
foreign libc {
|
|
arc4random_buf :: proc(buf: [^]byte, nbytes: uint) ---
|
|
}
|
|
|
|
@(private)
|
|
_rand_bytes :: proc(dst: []byte) {
|
|
arc4random_buf(raw_data(dst), len(dst))
|
|
}
|