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

Functions

func CryptoUint64

func CryptoUint64() (uint64, error)

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

func Intn(max int) int

Intn is a wrapper for math.Intn so only one package needs to be imported.

func Intn2

func Intn2(min, max int) int

Intn2 returns a random value between min and max, inclusive.

func Seed

func Seed() (uint64, error)

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.