fastrand: github.com/valyala/fastrand Index | Files

package fastrand

import "github.com/valyala/fastrand"

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

Package Files

fastrand.go

func Uint32 Uses

func Uint32() uint32

Uint32 returns pseudorandom uint32.

It is safe calling this function from concurrent goroutines.

func Uint32n Uses

func Uint32n(maxN uint32) uint32

Uint32n returns pseudorandom uint32 in the range [0..maxN).

It is safe calling this function from concurrent goroutines.

type RNG Uses

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 Uses

func (r *RNG) Uint32() uint32

Uint32 returns pseudorandom uint32.

It is unsafe to call this method from concurrent goroutines.

func (*RNG) Uint32n Uses

func (r *RNG) Uint32n(maxN uint32) uint32

Uint32n returns pseudorandom uint32 in the range [0..maxN).

It is unsafe to call this method from concurrent goroutines.

Package fastrand imports 2 packages (graph) and is imported by 9 packages. Updated 2019-03-23. Refresh now. Tools for package owners.