Documentation
¶
Overview ¶
Shuffle provides crypto/rand based shuffling (randomization) of collections using the Fisher-Yates (Knuth) shuffling algorithm. Functions for shuffling slices of non-composite types are provided, or you can implement the Shuffler interface and shuffle using the shuffle.Interface() func.
Shuffling is performed on the received slice; nothing is returned and no additional allocations, aside from those caused by using crypto/rand.
If using a math/rand based shuffle is good enough, see the github.com/mohae/shuffle/quick package, which provides a quick, pseudo-random shuffle.
Index ¶
- func Byte(c []byte) error
- func Complex128(c []complex128) error
- func Complex64(c []complex64) error
- func Float32(c []float32) error
- func Float64(c []float64) error
- func Int(c []int) error
- func Int16(c []int16) error
- func Int32(c []int32) error
- func Int64(c []int64) error
- func Int8(c []int8) error
- func Interface(c Shuffler) error
- func String(c []string) error
- func Uint(c []uint) error
- func Uint16(c []uint16) error
- func Uint32(c []uint32) error
- func Uint64(c []uint64) error
- func Uint8(c []uint8) error
- type Shuffler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.
