basic

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LowerLetterSet string = "abcdefghijklmnopqrstuvwxyz"
	UpperLetterSet string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	NumberSet      string = "0123456789"
	SymbolSet      string = "!@#$%^&*_+=-?:"
	AllTypeableSet string = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?"
)

Variables

View Source
var Words string

Functions

func CreateCommand

func CreateCommand() subcommands.Command

func DeleteCommand

func DeleteCommand() subcommands.Command

func GenerateChars

func GenerateChars(lc LengthChecker) (string, error)

func GenerateCommand

func GenerateCommand() subcommands.Command

func GenerateSymbols

func GenerateSymbols(lc LengthChecker) (string, error)

func GenerateWords

func GenerateWords(lc LengthChecker, wordList []string, sep string) (string, error)

func GetCommand

func GetCommand() subcommands.Command

func ListCommand

func ListCommand() subcommands.Command

func RandomChoice

func RandomChoice[T ~[]E, E any](set T) (out E, err error)

func RandomNOf

func RandomNOf[T ~[]E, E any](sets []T, n int) (T, int, error)

func SetCommand

func SetCommand() subcommands.Command

func UnlockCommand

func UnlockCommand() subcommands.Command

Types

type GenerateMode

type GenerateMode int
const (
	ModeWords GenerateMode = iota
	ModeCharacters
	ModeAllSymbols
)

func ParseMode

func ParseMode(m string) (GenerateMode, error)

type LengthChecker

type LengthChecker interface {
	LongEnough(selections ...int) bool
}

func NewLengthChecker

func NewLengthChecker(bits, length int) (LengthChecker, error)

Jump to

Keyboard shortcuts

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