rand

package module
v0.0.0-...-4b6bc4c Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

fastrand

High performance rand library for go.

Ready for use in production.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpFloat64

func ExpFloat64() float64

func ExpFloat64LF

func ExpFloat64LF() float64

func Float32

func Float32() float32

func Float32LF

func Float32LF() float32

func Float64

func Float64() float64

func Float64LF

func Float64LF() float64

func Int

func Int() int

func Int31

func Int31() int32

func Int31LF

func Int31LF() int32

func Int31n

func Int31n(n int32) int32

func Int31nLF

func Int31nLF(n int32) int32

func Int63

func Int63() int64

func Int63LF

func Int63LF() int64

func Int63n

func Int63n(n int64) int64

func Int63nLF

func Int63nLF(n int64) int64

func IntLF

func IntLF() int

func Intn

func Intn(n int) int

func IntnLF

func IntnLF(n int) int

func NormFloat64

func NormFloat64() float64

func NormFloat64LF

func NormFloat64LF() float64

func Perm

func Perm(n int) []int

func PermLF

func PermLF(n int) []int

func Read

func Read(p []byte) (int, error)

func ReadLF

func ReadLF(p []byte) (int, error)

func Seed

func Seed(seed int64)

func SeedLF

func SeedLF(seed int64)

func Shuffle

func Shuffle(n int, swap func(i, j int))

func ShuffleLF

func ShuffleLF(n int, swap func(i, j int))

func Uint32

func Uint32() uint32

func Uint32LF

func Uint32LF() uint32

func Uint64

func Uint64() uint64

func Uint64LF

func Uint64LF() uint64

Types

type LockFree

type LockFree []*lockFreeSource

LockFree can only be used if GOMAXPROCS isn't adjusted at runtime.

func NewLockFree

func NewLockFree() LockFree

func (LockFree) ExpFloat64

func (l LockFree) ExpFloat64() (r float64)

func (LockFree) Float32

func (l LockFree) Float32() (r float32)

func (LockFree) Float64

func (l LockFree) Float64() (r float64)

func (LockFree) Int

func (l LockFree) Int() (r int)

func (LockFree) Int31

func (l LockFree) Int31() (r int32)

func (LockFree) Int31n

func (l LockFree) Int31n(n int32) (r int32)

func (LockFree) Int63

func (l LockFree) Int63() (r int64)

func (LockFree) Int63n

func (l LockFree) Int63n(n int64) (r int64)

func (LockFree) Intn

func (l LockFree) Intn(n int) (r int)

func (LockFree) NormFloat64

func (l LockFree) NormFloat64() (r float64)

func (LockFree) Perm

func (l LockFree) Perm(n int) (r []int)

func (LockFree) Read

func (l LockFree) Read(p []byte) (n int, err error)

func (LockFree) Seed

func (l LockFree) Seed(seed int64)

func (LockFree) Shuffle

func (l LockFree) Shuffle(n int, swap func(i, j int))

func (LockFree) Uint32

func (l LockFree) Uint32() (r uint32)

func (LockFree) Uint64

func (l LockFree) Uint64() (r uint64)

type Locked

type Locked []*lockedSource

Locked is p-sharded, can be used safely in situations where GOMAXPROCS is adjusted at runtime.

func NewLocked

func NewLocked() Locked

func (Locked) ExpFloat64

func (l Locked) ExpFloat64() float64

func (Locked) Float32

func (l Locked) Float32() float32

func (Locked) Float64

func (l Locked) Float64() float64

func (Locked) Int

func (l Locked) Int() int

func (Locked) Int31

func (l Locked) Int31() int32

func (Locked) Int31n

func (l Locked) Int31n(n int32) int32

func (Locked) Int63

func (l Locked) Int63() int64

func (Locked) Int63n

func (l Locked) Int63n(n int64) int64

func (Locked) Intn

func (l Locked) Intn(n int) int

func (Locked) NormFloat64

func (l Locked) NormFloat64() float64

func (Locked) Perm

func (l Locked) Perm(n int) []int

func (Locked) Read

func (l Locked) Read(p []byte) (int, error)

func (Locked) Seed

func (l Locked) Seed(seed int64)

func (Locked) Shuffle

func (l Locked) Shuffle(n int, swap func(i, j int))

func (Locked) Uint32

func (l Locked) Uint32() uint32

func (Locked) Uint64

func (l Locked) Uint64() uint64

Jump to

Keyboard shortcuts

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