rand

package
v1.80.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MPL-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package rand provides a Randomizer based upon the crypto/rand package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Randomizer

type Randomizer interface {
	// Intn returns a non-negative random number from 0 to n-1. If n <= 0, the implementation should return 0.
	Intn(n int) int
}

Randomizer defines a source of random integer values.

func NewCryptoRand

func NewCryptoRand() Randomizer

NewCryptoRand returns a Randomizer based on the crypto/rand package. This method returns a shared singleton instance and does not allocate.

Jump to

Keyboard shortcuts

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