mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
17 lines
243 B
Go
17 lines
243 B
Go
|
package testutil
|
||
|
|
||
|
import (
|
||
|
"crypto/rand"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
// Random32Bytes generates a random 32 byte slice.
|
||
|
func Random32Bytes(t *testing.T) []byte {
|
||
|
b := make([]byte, 32)
|
||
|
_, err := rand.Read(b)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
return b
|
||
|
}
|