| 123456789101112131415161718192021222324252627 | package protocolimport (	"math/rand"	"time"	"github.com/v2ray/v2ray-core/common/serial")type Timestamp int64func (this Timestamp) Bytes(b []byte) []byte {	return serial.Int64ToBytes(int64(this), b)}type TimestampGenerator func() Timestampfunc NowTime() Timestamp {	return Timestamp(time.Now().Unix())}func NewTimestampGenerator(base Timestamp, delta int) TimestampGenerator {	return func() Timestamp {		rangeInDelta := rand.Intn(delta*2) - delta		return base + Timestamp(rangeInDelta)	}}
 |