random

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package random provides cryptographically secure random number generation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Randomizer

type Randomizer struct {
	io.Reader
}

Randomizer implements the io.Reader interface. A Randomizer can be used to generate random bytes.

func NewRandomizer

func NewRandomizer() Randomizer

NewRandomizer returns a new Randomizer instance. It uses the crypto/rand package to generate random bytes.

func (Randomizer) GenerateBytes

func (r Randomizer) GenerateBytes(n int) ([]byte, error)

GenerateBytes generates a n bytes slice of random bytes. It can return an error if the random bytes cannot be read. For further information, see the io.Reader interface.

Jump to

Keyboard shortcuts

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