protobuf: google.golang.org/protobuf/internal/detrand Index | Files

package detrand

import "google.golang.org/protobuf/internal/detrand"

Package detrand provides deterministically random functionality.

The pseudo-randomness of these functions is seeded by the program binary itself and guarantees that the output does not change within a program, while ensuring that the output is unstable across different builds.

Index

Package Files

rand.go

func Bool Uses

func Bool() bool

Bool returns a deterministically random boolean.

func Disable Uses

func Disable()

Disable disables detrand such that all functions returns the zero value. This function is not concurrent-safe and must be called during program init.

func Intn Uses

func Intn(n int) int

Intn returns a deterministically random integer between 0 and n-1, inclusive.

Package detrand imports 3 packages (graph) and is imported by 7 packages. Updated 2020-07-14. Refresh now. Tools for package owners.