mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-06-02 01:09:08 -04:00
dice.RandomUint16
This commit is contained in:
@@ -15,6 +15,11 @@ func Roll(n int) int {
|
||||
return rand.Intn(n)
|
||||
}
|
||||
|
||||
// RandomUint16 returns a random uint16 value.
|
||||
func RandomUint16() uint16 {
|
||||
return uint16(rand.Intn(65536))
|
||||
}
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().Unix())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user