Documentation ¶
Overview ¶
Package saferand implements a cryptographically secure (mostly) drop-in replacement for exp/rand (and math/rand).
import rand "github.com/ericlagergren/saferand"
All Seed functions and methods are no-ops.
Index ¶
- func ExpFloat64() float64
- func Float32() float32
- func Float64() float64
- func Int() int
- func Int31() int32
- func Int31n(n int32) int32
- func Int63() int64
- func Int63n(n int64) int64
- func Intn(n int) int
- func NewSource() exprand.Source
- func NormFloat64() float64
- func Perm(n int) []int
- func Read(p []byte) (int, error)
- func Seed(_ uint64)
- func Shuffle(n int, swap func(i, j int))
- func Uint32() uint32
- func Uint64() uint64
- type ExpSource
- type Rand
- type Source
- type Zipf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpFloat64 ¶
func ExpFloat64() float64
func NewSource ¶
NewSource returns a cryptographically secure Source.
Unlike math/rand, the returned Source is safe for concurrent use by multiple goroutines.
func NormFloat64 ¶
func NormFloat64() float64
Types ¶
Click to show internal directories.
Click to hide internal directories.