mirror of
https://github.com/aljazceru/lspd.git
synced 2026-01-08 16:44:20 +01:00
15 lines
244 B
Go
15 lines
244 B
Go
package itest
|
|
|
|
import "crypto/rand"
|
|
|
|
func GenerateRandomBytes(n int) ([]byte, error) {
|
|
b := make([]byte, n)
|
|
_, err := rand.Read(b)
|
|
// Note that err == nil only if we read len(b) bytes.
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return b, nil
|
|
}
|