mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-19 16:11:30 +00:00
12 lines
289 B
Odin
12 lines
289 B
Odin
package crypto
|
|
|
|
import "core:fmt"
|
|
import "core:sys/darwin"
|
|
|
|
_rand_bytes :: proc(dst: []byte) {
|
|
res := darwin.SecRandomCopyBytes(count=len(dst), bytes=raw_data(dst))
|
|
if res != .Success {
|
|
panic(fmt.tprintf("crypto/rand_bytes: SecRandomCopyBytes returned non-zero result: %v", res))
|
|
}
|
|
}
|