Documentation ¶
Overview ¶
Package fastrand implements fast pesudorandom number generator that should scale well on multi-CPU systems.
Use crypto/rand instead of this package for generating cryptographically secure random numbers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read generates len(p) random bytes from the default Source and writes them into p. It always returns len(p) and a nil error. Read, unlike the Rand.Read method, is safe for concurrent use.
func Uint32 ¶
func Uint32() uint32
Uint32 returns pseudorandom uint32.
It is safe calling this function from concurrent goroutines.
Types ¶
type RNG ¶
type RNG struct {
// contains filtered or unexported fields
}
RNG is a pseudorandom number generator.
It is unsafe to call RNG methods from concurrent goroutines.
func (*RNG) Uint32 ¶
Uint32 returns pseudorandom uint32.
It is unsafe to call this method from concurrent goroutines.