rand

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rand is used for concurrency safe random number generator. This package provides a thread-safe wrapper around math/rand for use in load balancing and server selection. It is NOT suitable for cryptographic purposes and should not be used for security-sensitive operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rand

type Rand struct {
	// contains filtered or unexported fields
}

Rand is used for concurrency safe random number generator.

func New

func New(seed int64) *Rand

New returns a new Rand from seed.

func (*Rand) Int

func (r *Rand) Int() int

Int returns a non-negative pseudo-random int from the Source in Rand.r.

func (*Rand) Perm

func (r *Rand) Perm(n int) []int

Perm returns, as a slice of n ints, a pseudo-random permutation of the integers in the half-open interval [0,n) from the Source in Rand.r.

Jump to

Keyboard shortcuts

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