mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
18 lines
248 B
Go
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())
|
|
}
|