chore: use fastrand to replace math/rand
This commit is contained in:
@ -4,8 +4,9 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
|
||||
"github.com/zhangyunhao116/fastrand"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -68,7 +69,7 @@ func getHeadSize(b []byte, defaultValue int) int {
|
||||
|
||||
func getDataLength(b []byte) int {
|
||||
bLength := len(b)
|
||||
dataLength := getHeadSize(b, 30) + rand.Intn(32)
|
||||
dataLength := getHeadSize(b, 30) + fastrand.Intn(32)
|
||||
if bLength < dataLength {
|
||||
return bLength
|
||||
}
|
||||
|
Reference in New Issue
Block a user