1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00
v2fly/proxy/vmess/protocol/user/rand.go

13 lines
242 B
Go
Raw Normal View History

2015-09-19 18:11:14 -04:00
package user
2015-09-16 15:13:13 -04:00
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)
}