16 lines
193 B
Go
16 lines
193 B
Go
|
package langext
|
||
|
|
||
|
import (
|
||
|
"crypto/rand"
|
||
|
"io"
|
||
|
)
|
||
|
|
||
|
func RandBytes(size int) []byte {
|
||
|
b := make([]byte, size)
|
||
|
_, err := io.ReadFull(rand.Reader, b)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
return b
|
||
|
}
|