mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
crypto: Add rand_bytes
This adds `rand_bytes(dst: []byte)` which fills the destination buffer with entropy from the cryptographic random number generator. This takes the "simple is best" approach and just directly returns the OS CSPRNG output instead of doing anything fancy (a la OpenBSD's arc4random).
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package crypto
|
||||
|
||||
when ODIN_OS != "linux" {
|
||||
_rand_bytes :: proc (dst: []byte) {
|
||||
unimplemented("crypto: rand_bytes not supported on this OS")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user