core: v2ray.com/core/common/dice Index | Files

package dice

import "v2ray.com/core/common/dice"

Package dice contains common functions to generate random number. It also initialize math/rand with the time in seconds at launch time.

Index

Package Files

dice.go

func NewDeterministicDice Uses

func NewDeterministicDice(seed int64) *deterministicDice

func Roll Uses

func Roll(n int) int

Roll returns a non-negative number between 0 (inclusive) and n (exclusive).

func RollDeterministic Uses

func RollDeterministic(n int, seed int64) int

Roll returns a non-negative number between 0 (inclusive) and n (exclusive).

func RollUint16 Uses

func RollUint16() uint16

RollUint16 returns a random uint16 value.

func RollUint64 Uses

func RollUint64() uint64

Package dice imports 2 packages (graph) and is imported by 125 packages. Updated 2020-06-06. Refresh now. Tools for package owners.