rand

package
v4.5.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 67

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64

func Int64() int64

Int64 returns a random int64 number. It can be negative. This function uses a pool and is lockless.

func Uint64

func Uint64() uint64

Uint64 returns a random uint64 number. This function uses a pool and is lockless.

Types

type Xor128Rand

type Xor128Rand struct {
	// contains filtered or unexported fields
}

Xor128Rand is a random number generator

func NewXorRand

func NewXorRand() *Xor128Rand

NewXorRand creates a XOR Shift random number generator.

func (*Xor128Rand) Int64

func (r *Xor128Rand) Int64() int64

Int64 returns a random int64 number. It can be negative.

func (*Xor128Rand) Read

func (r *Xor128Rand) Read(p []byte) (n int, err error)

Read will fill the argument slice with random bytes. Implements the Reader interface.

func (*Xor128Rand) Uint64

func (r *Xor128Rand) Uint64() uint64

Uint64 returns a random uint64 number.

Jump to

Keyboard shortcuts

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