1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-03 07:56:42 -05:00
v2fly/testing/fuzzing/fuzzing.go
2015-11-10 12:13:01 +01:00

18 lines
248 B
Go

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())
}