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

Function SetRand

uuid.go:319–325  ·  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

317// Calling SetRand with nil sets the random number generator to the default
318// generator.
319func SetRand(r io.Reader) {
320 if r == nil {
321 rander = rand.Reader
322 return
323 }
324 rander = r
325}
326
327// EnableRandPool enables internal randomness pool used for Random
328// (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