wadey / cryptorand

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

Home Page:http://godoc.org/github.com/wadey/cryptorand

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

http://godoc.org/github.com/wadey/cryptorand

License:MIT License


Languages

Language:Go 100.0%