kubo/test/cli/testutils/random.go
2023-01-04 09:45:44 +01:00

13 lines
177 B
Go

package testutils
import "crypto/rand"
func RandomBytes(n int) []byte {
bytes := make([]byte, n)
_, err := rand.Read(bytes)
if err != nil {
panic(err)
}
return bytes
}