Documentation ¶
Overview ¶
From AllInBits, Inc, TendermintClassic: github.com/tendermint/classic. License: Apache2.0.
Index ¶
- func RandBool() bool
- func RandBytes(n int) []byte
- func RandFloat32() float32
- func RandFloat64() float64
- func RandInt() int
- func RandInt16() int16
- func RandInt31() int32
- func RandInt31n(n int32) int32
- func RandInt32() int32
- func RandInt63() int64
- func RandInt63n(n int64) int64
- func RandInt64() int64
- func RandIntn(n int) int
- func RandPerm(n int) []int
- func RandStr(length int) string
- func RandTime() time.Time
- func RandUint() uint
- func RandUint16() uint16
- func RandUint32() uint32
- func RandUint64() uint64
- func Seed(seed int64)
- type Rand
- func (r *Rand) Bool() bool
- func (r *Rand) Bytes(n int) []byte
- func (r *Rand) Float32() float32
- func (r *Rand) Float64() float64
- func (r *Rand) Int() int
- func (r *Rand) Int16() int16
- func (r *Rand) Int31() int32
- func (r *Rand) Int31n(n int32) int32
- func (r *Rand) Int32() int32
- func (r *Rand) Int63() int64
- func (r *Rand) Int63n(n int64) int64
- func (r *Rand) Int64() int64
- func (r *Rand) Intn(n int) int
- func (r *Rand) Perm(n int) []int
- func (r *Rand) Seed(seed int64)
- func (r *Rand) Str(length int) string
- func (r *Rand) Time() time.Time
- func (r *Rand) Uint() uint
- func (r *Rand) Uint16() uint16
- func (r *Rand) Uint32() uint32
- func (r *Rand) Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandFloat32 ¶
func RandFloat32() float32
func RandFloat64 ¶
func RandFloat64() float64
func RandInt31n ¶
func RandInt63n ¶
func RandUint16 ¶
func RandUint16() uint16
func RandUint32 ¶
func RandUint32() uint32
func RandUint64 ¶
func RandUint64() uint64
Types ¶
type Rand ¶
Rand is a prng, that is seeded with OS randomness. The OS randomness is obtained from crypto/rand, however none of the provided methods are suitable for cryptographic usage. They all utilize math/rand's prng internally.
All of the methods here are suitable for concurrent use. This is achieved by using a mutex lock on all of the provided methods.
func (*Rand) Intn ¶
Intn returns, as an int, a uniform pseudo-random number in the range [0, n). It panics if n <= 0.
Click to show internal directories.
Click to hide internal directories.