fastrand

package
v0.0.0-...-f50d829 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package fastrand provides a fast random number generator based on xorshift

This sort of thing is frequently needed during benchmarks, and using math/rand will make create a single-threaded bottleneck. Using rand.New() is expensive so always creating multiple sources isn't always an answer either.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rng

type Rng uint64

func (*Rng) Int32n

func (r *Rng) Int32n(n uint32) uint32

func (*Rng) Intn

func (r *Rng) Intn(bound uint64) uint64

Intn returns a uniform random integer [0,bound)

func (*Rng) Next

func (r *Rng) Next() uint64

Next returns the next random number

Jump to

Keyboard shortcuts

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