Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 579 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 579 Bytes

cryptorand

-- import "github.com/wadey/cryptorand"

Package cryptorand provides a math/rand.Source64 implementation of crypto/rand

Example

r := rand.New(cryptorand.Source)
fmt.Println(r.Float64() == r.Float64())

// Output:
// false

Usage

var Source rand.Source

Source is a math/rand.Source64 backed by crypto/rand. Calling Seed() will result in a panic.

func NewSource

func NewSource(rand io.Reader) rand.Source

NewSource returns a new rand.Source64 backed by the given random source. Calling Seed() will result in a panic.