rand

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: BSD-2-Clause, ISC Imports: 3 Imported by: 0

Documentation

Overview

Package rand contains utilities for interacting with math/rand, including seeding from a random sed.

Index

Constants

This section is empty.

Variables

This section is empty.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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