1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-09 03:37:37 -05:00
v2fly/proxy/vmess/protocol/user/rand.go
2015-09-20 00:11:14 +02:00

13 lines
242 B
Go

package user
import (
"math/rand"
)
type RandomInt64InRange func(base int64, delta int) int64
func GenerateRandomInt64InRange(base int64, delta int) int64 {
rangeInDelta := rand.Intn(delta*2) - delta
return base + int64(rangeInDelta)
}