password

package
v1.153.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 4 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

This section is empty.

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(algo argon2.Algo) *Secure

NewSecure password.

func (*Secure) Generate added in v1.10.4

func (s *Secure) Generate(length Length) (string, error)

Generate secure password.

func (*Secure) Hash added in v1.10.4

func (s *Secure) Hash(pass string) (string, error)

Hash the password.

func (*Secure) Verify added in v1.147.0

func (s *Secure) Verify(hash, pass string) error

Verify the password with the hash.

Jump to

Keyboard shortcuts

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