MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / NewPseudoRand

Function NewPseudoRand

cmd/cql-fuse/randbytes.go:45–48  ·  view source on GitHub ↗

NewPseudoRand returns an instance of math/rand.Rand seeded from crypto/rand and its seed so we can easily and cheaply generate unique streams of numbers. The created object is not safe for concurrent access.

()

Source from the content-addressed store, hash-verified

43// and its seed so we can easily and cheaply generate unique streams of
44// numbers. The created object is not safe for concurrent access.
45func NewPseudoRand() (*rand.Rand, int64) {
46 seed := time.Now().UnixNano()
47 return rand.New(rand.NewSource(seed)), seed
48}
49
50// RandBytes returns a byte slice of the given length with random
51// data.

Callers 1

TestReadWriteBlocksFunction · 0.85

Calls 1

NewMethod · 0.65

Tested by 1

TestReadWriteBlocksFunction · 0.68