random

package
v0.0.0-...-9518a5e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 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 {
	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) 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