randx

package
v0.0.0-...-60fd972 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool() bool

func Float32

func Float32() float32

Float32 returns, as a float32, a pseudo-random number in the half-open interval [0.0,1.0).

func Float64

func Float64() float64

Float64 returns, as a float64, a pseudo-random number in the half-open interval [0.0,1.0).

func Get

func Get() *rand.Rand

func HexString

func HexString(length int) string

HexString Generate a random number sequence of a given length

func Int

func Int() int

Int returns a non-negative pseudo-random int.

func Int31

func Int31() int32

Int31 returns a non-negative pseudo-random 31-bit integer as an int32.

func Int31Range

func Int31Range(min, max int32) int32

Int31Range returns a non-negative pseudo-random 31-bit integer as an int32 between min and max.

func Int31n

func Int31n(n int32) int32

Int31n returns, as an int32, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n <= 0.

func Int63

func Int63() int64

Int63 returns a non-negative pseudo-random 63-bit integer as an int64.

func Int63Range

func Int63Range(min, max int64) int64

Int63Range returns a non-negative pseudo-random 63-bit integer as an int64 between min and max.

func Int63n

func Int63n(n int64) int64

Int63n returns, as an int64, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n <= 0.

func IntRange

func IntRange(min, max int) int

IntRange returns a non-negative pseudo-random int between min and max.

func Intn

func Intn(n int) int

Intn returns, as an int, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n <= 0.

func NewSyncSource

func NewSyncSource(seed int64) rand.Source

func NumericString

func NumericString(length int) string

NumericString Generate a random number sequence of a given length

func Put

func Put(r *rand.Rand)

func Rand

func Rand() rand.Source

func Shuffle

func Shuffle[S ~[]E, E any](s S) S

func SyncSource

func SyncSource() rand.Source

func Uint

func Uint() uint

Uint returns a non-negative pseudo-random uint.

func Uint32

func Uint32() uint32

Uint32 returns a pseudo-random 32-bit value as a uint32.

func Uint32Range

func Uint32Range(min, max uint32) uint32

Uint32Range returns a pseudo-random 32-bit value as a uint32 between min and max.

func Uint64

func Uint64() uint64

Uint64 returns a pseudo-random 64-bit value as a uint64.

func Uint64Range

func Uint64Range(min, max uint64) uint64

Uint64Range returns a pseudo-random 64-bit value as a uint64 between min and max.

func UintRange

func UintRange(min, max uint) uint

UintRange returns a non-negative pseudo-random int between min and max.

func Uintn

func Uintn(n uint) uint

Uintn returns, as an uint, a non-negative pseudo-random number in the half-open interval [0,n). It panics if n <= 0.

func WordString

func WordString(length int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL