1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-24 05:09:09 -04:00

leverage dice.Roll

This commit is contained in:
v2ray
2016-06-29 23:53:50 +02:00
parent 71c9bd678c
commit 98cc28a4c4
3 changed files with 6 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
package protocol
import (
"math/rand"
"time"
"github.com/v2ray/v2ray-core/common/dice"
"github.com/v2ray/v2ray-core/common/serial"
)
@@ -21,7 +21,7 @@ func NowTime() Timestamp {
func NewTimestampGenerator(base Timestamp, delta int) TimestampGenerator {
return func() Timestamp {
rangeInDelta := rand.Intn(delta*2) - delta
rangeInDelta := dice.Roll(delta*2) - delta
return base + Timestamp(rangeInDelta)
}
}