randutil

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntBetween

func IntBetween(rand *mathrand.Rand, min, max int) int

IntBetween generates a random number in the range of [min, max).

func NewCryptoSeededConcurrentSafeRand

func NewCryptoSeededConcurrentSafeRand() *mathrand.Rand

NewCryptoSeededConcurrentSafeSource generates a new pseudo-random source that's been created with a cryptographically secure seed to ensure reasonable distribution of randomness between nodes and services, and wrapped so that access to it is concurrent safe.

This project uses this technique instead of falling back on crypto/rand because uses of randomness don't need to be cryptographically secure, and the non-crypto variant is about twenty times faster.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL