rand

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package rand is a collection of utility functions for generating random numbers and identifiers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaNum32

func AlphaNum32(length int) string

AlphaNum32 generates a random string of the specified length. The string will include only uppercase letters and numbers A-V, 0-9.

func AlphaNum64

func AlphaNum64(length int) string

AlphaNum64 generates a random string of the specified length. The string will include only alphanumeric characters a-z, A-Z, 0-9.

func IntN added in v1.13.1

func IntN(n int) int

IntN returns, as an int, a pseudo-random number in the half-open interval [0,n) from the default Source. It panics if n <= 0.

func Read

func Read(bytes []byte) (n int, err error)

Read generates random bytes and writes them into the buffer. It always returns the length of the buffer and a nil error.

Types

type Void

type Void any

Void is an empty type.

Jump to

Keyboard shortcuts

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