Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MathRandomGenerator ¶
type MathRandomGenerator interface { // Intn returns random integer within [0:n). Intn(n int) int // Uint32 returns random 32-bit unsigned integer. Uint32() uint32 // Uint64 returns random 64-bit unsigned integer. Uint64() uint64 // GenerateString returns ranom string using given set of runes. // It can be used for generating unique ID to avoid name collision. // // Caution: DO NOT use this for cryptographic usage. GenerateString(n int, runes string) string }
MathRandomGenerator is a random generator for non-crypto usage.
func NewMathRandomGenerator ¶
func NewMathRandomGenerator() MathRandomGenerator
NewMathRandomGenerator creates new mathmatical random generator. Random generator is seeded by crypto random.
Click to show internal directories.
Click to hide internal directories.