rand

package
v0.0.0-...-883d5d7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

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