random

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomBytes

func RandomBytes(n uint32) ([]byte, error)

RandomBytes generates a slice of `n` random bytes using crypto/rand. Returns an error if random byte generation fails.

func RandomInt

func RandomInt(min, max int) (int, error)

RandomInt returns a cryptographically secure random integer between `min` and `max`. Returns an error if min >= max.

func RandomString

func RandomString(n int) string

RandomString generates a random alphanumeric string of length `n`. It uses crypto/rand for cryptographically secure randomness.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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