MCPcopy
hub / github.com/google/uuid / SetRand

Function SetRand

uuid.go:347–353  ·  view source on GitHub ↗

SetRand sets the random number generator to r, which implements io.Reader. If r.Read returns an error when the package requests random data then a panic will be issued. Calling SetRand with nil sets the random number generator to the default generator.

(r io.Reader)

Source from the content-addressed store, hash-verified

345// Calling SetRand with nil sets the random number generator to the default
346// generator.
347func SetRand(r io.Reader) {
348 if r == nil {
349 rander = rand.Reader
350 return
351 }
352 rander = r
353}
354
355// EnableRandPool enables internal randomness pool used for Random
356// (Version 4) UUID generation. The pool contains random bytes read from

Callers 6

TestBadRandFunction · 0.85
TestSetRandFunction · 0.85
TestRandPoolFunction · 0.85
TestVersion7Function · 0.85
TestVersion7_pooledFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestBadRandFunction · 0.68
TestSetRandFunction · 0.68
TestRandPoolFunction · 0.68
TestVersion7Function · 0.68
TestVersion7_pooledFunction · 0.68