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.
13 lines
242 B
13 lines
242 B
9 years ago
|
package user
|
||
9 years ago
|
|
||
|
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)
|
||
|
}
|