random

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

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