rand

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: AGPL-3.0 Imports: 16 Imported by: 60

Documentation

Overview

Package rand provides various utitilies related to generating cryptographically secure random numbers and byte vectors.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Reader is a replacement for crypto/rand.Reader.
	Reader io.Reader
)

Functions

func Exp

func Exp(r *rand.Rand, lambda float64) float64

Exp returns a random sample from the exponential distribution characterized by lambda (inverse of the mean).

func ExpQuantile

func ExpQuantile(lambda, p float64) float64

ExpQuantile returns the value at which the the probability of a random value is less than or equal to the given probability for an exponential distribution characterized by lambda.

func NewMath

func NewMath() *rand.Rand

NewMath returns a "cryptographically secure" math/rand.Rand.

func Poisson

func Poisson(r *rand.Rand, lambda float64) int

Poisson returns a random sample from the poisson distribution characterized by lambda (mean).

Types

This section is empty.

Jump to

Keyboard shortcuts

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