mirror of https://github.com/v2ray/v2ray-core
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.
18 lines
248 B
18 lines
248 B
9 years ago
|
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())
|
||
|
}
|