random

package
v0.0.0-...-98cd694 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProvidersRandom = wire.NewSet(
	NewGenerator,
)

ProvidersRandom are what we offer to dependency injection.

Functions

func GenerateBase32EncodedString

func GenerateBase32EncodedString(ctx context.Context, length int) (string, error)

GenerateBase32EncodedString generates a one-off value with an anonymous Generator.

func GenerateBase64EncodedString

func GenerateBase64EncodedString(ctx context.Context, length int) (string, error)

GenerateBase64EncodedString generates a one-off value with an anonymous Generator.

func GenerateHexEncodedString

func GenerateHexEncodedString(ctx context.Context, length int) (string, error)

GenerateHexEncodedString generates a one-off value with an anonymous Generator.

func GenerateRawBytes

func GenerateRawBytes(ctx context.Context, length int) ([]byte, error)

GenerateRawBytes generates a one-off value with an anonymous Generator.

Types

type Generator

type Generator interface {
	GenerateHexEncodedString(ctx context.Context, length int) (string, error)
	GenerateBase32EncodedString(context.Context, int) (string, error)
	GenerateBase64EncodedString(context.Context, int) (string, error)
	GenerateRawBytes(context.Context, int) ([]byte, error)
}

Generator should generate random strings securely.

func NewGenerator

func NewGenerator(logger logging.Logger, tracerProvider tracing.TracerProvider) Generator

NewGenerator builds a new Generator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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