jsf32

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: BlueOak-1.0.0 Imports: 0 Imported by: 0

Documentation

Overview

Package jsf32 provides the 32-bit version of Bob Jenkins' public-domain small noncryptographic PRNG

The original C implementation can be found here: https://burtleburtle.net/bob/rand/smallprng.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSF32

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

JSF32 implements the math/rand.Source64 interface

Callers must seed a generator through New() or Seed() before generating any numbers. An unseeded JSF32 (the zero value) will always produce a 0

func New

func New(seed int64) *JSF32

New returns a seeded generator

func (*JSF32) Int31

func (j *JSF32) Int31() int32

Int31 returns a pseudorandom value in [0, 1<<31)

func (*JSF32) Int63

func (j *JSF32) Int63() int64

Int63 returns a pseudorandom value in [0, 1<<63)

func (*JSF32) Seed

func (j *JSF32) Seed(seed int64)

Seed (re)initializes the generator. Only the lower 32 bits of seed are used.

func (*JSF32) Uint32

func (j *JSF32) Uint32() uint32

Uint32 returns a pseudorandom value in [0, 1<<32)

func (*JSF32) Uint64

func (j *JSF32) Uint64() uint64

Uint64 returns a pseudorandom value in [0, 1<<64)

Jump to

Keyboard shortcuts

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