You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/testing/fuzzing/fuzzing.go

18 lines
248 B

package fuzzing
import (
"bytes"
"crypto/rand"
"io"
)
func RandomBytes() []byte {
buffer := make([]byte, 256)
rand.Read(buffer)
return buffer[1 : 1+int(buffer[0])]
}
func RandomReader() io.Reader {
return bytes.NewReader(RandomBytes())
}