uniformprng

package
v0.0.0-...-96115ed Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: ISC Imports: 4 Imported by: 0

Documentation

Overview

Package uniformprng implements a uniform, cryptographically secure pseudo-random number generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

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

Source returns cryptographically-secure pseudorandom numbers with uniform distribution.

func NewSource

func NewSource(seed *[32]byte) *Source

NewSource seeds a Source from a 32-byte key.

func RandSource

func RandSource(rand io.Reader) (*Source, error)

RandSource creates a Source with seed randomness read from rand.

func (*Source) Uint32

func (s *Source) Uint32() uint32

Uint32 returns a pseudo-random uint32.

func (*Source) Uint32n

func (s *Source) Uint32n(n uint32) uint32

Uint32n returns a pseudo-random uint32 in range [0,n) without modulo bias.

Jump to

Keyboard shortcuts

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