package rand
import "git.wntrmute.dev/kyle/goutils/rand"
Package rand contains utilities for interacting with math/rand, including seeding from a random sed.
Index ¶
- func CryptoUint64() (uint64, error)
- func Int() int
- func Intn(max int) int
- func Intn2(min, max int) int
- func Seed() (uint64, error)
Functions ¶
func CryptoUint64 ¶
CryptoUint64 generates a cryptographically-secure 64-bit integer.
func Int ¶
func Int() int
Int is a wrapper for math.Int so only one package needs to be imported.
func Intn ¶
Intn is a wrapper for math.Intn so only one package needs to be imported.
func Intn2 ¶
Intn2 returns a random value between min and max, inclusive.
func Seed ¶
Seed initialises the non-cryptographic PRNG with a random, cryptographically secure value. This is done just as a good way to make this random. The returned 64-bit value is the seed.
Source Files ¶
rand.go
- Version
- v1.7.7 (latest)
- Published
- Jun 15, 2024
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 days ago –
Tools for package owners.