Files
Odin/core/crypto/rand_bsd.odin
T
2024-04-13 00:11:42 +01:00

17 lines
278 B
Odin

//+build freebsd, openbsd
package crypto
foreign import libc "system:c"
foreign libc {
arc4random_buf :: proc(buf: [^]byte, nbytes: uint) ---
}
_rand_bytes :: proc(dst: []byte) {
arc4random_buf(raw_data(dst), len(dst))
}
_has_rand_bytes :: proc() -> bool {
return true
}