Remove dice package

This commit is contained in:
Fangliding
2026-11-05 18:19:47 +08:00
parent a52db8f6ed
commit c8c24a2e60
20 changed files with 40 additions and 149 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
package protocol
import (
"math/rand/v2"
"time"
"github.com/xtls/xray-core/common/dice"
)
type Timestamp int64
@@ -16,7 +15,7 @@ func NowTime() Timestamp {
func NewTimestampGenerator(base Timestamp, delta int) TimestampGenerator {
return func() Timestamp {
rangeInDelta := dice.Roll(delta*2) - delta
rangeInDelta := rand.N(delta*2) - delta
return base + Timestamp(rangeInDelta)
}
}