password

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidLength for password.
	ErrInvalidLength = errors.New("invalid length")

	// DefaultLength for password.
	DefaultLength = Length(64)
)

Module for fx.

Functions

func NewGenerator added in v1.12.2

func NewGenerator(input *password.GeneratorInput) (*password.Generator, error)

NewGenerator for password.

func NewGeneratorInput added in v1.12.2

func NewGeneratorInput() *password.GeneratorInput

NewGeneratorInput for password.

Types

type Length added in v1.13.0

type Length uint32

Length to generate password.

func (Length) Valid added in v1.13.0

func (l Length) Valid() error

Valid length

type Secure added in v1.10.4

type Secure struct {
	// contains filtered or unexported fields
}

Secure password.

func NewSecure added in v1.10.4

func NewSecure(generator *password.Generator) *Secure

NewSecure password.

func (*Secure) Compare added in v1.10.4

func (s *Secure) Compare(ctx context.Context, hash, pass string) error

Compare using bcrypt.

func (*Secure) Generate added in v1.10.4

func (s *Secure) Generate(ctx context.Context, length Length) (string, error)

Generate secure password.

func (*Secure) Hash added in v1.10.4

func (s *Secure) Hash(ctx context.Context, pass string) (string, error)

Hash the password using bcrypt.

Jump to

Keyboard shortcuts

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