password

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelUndefined Level = iota

	// LevelEasy is the options for a weak password.
	LevelEasy = 1

	// LevelMid is the options for a mid-strength password.
	LevelMid = 2

	// LevelHard is the options for a strong password.
	LevelHard = 3
)

Variables

This section is empty.

Functions

func Generate

func Generate(level Level) (string, error)

func GenerateWithOptions

func GenerateWithOptions(options *Options) (string, error)

func Prompt

func Prompt(label string) (string, error)

Types

type Level

type Level int

type Options

type Options struct {
	// Length implies the Length of password, inclusive range is [1, 64].
	Length int

	// NumDigits implies the number of digits contained in a password.
	NumDigits int

	// NumSymbols implies the number of symbols contained in a password.
	NumSymbols int

	// Uppercase implies if password should contain upper case letters.
	Uppercase bool

	// NoRepeat implies if password should not contain repeated characters.
	NoRepeat bool
}

Jump to

Keyboard shortcuts

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