Back to

Package pwgen

Latest Go to latest
Published: Jul 26, 2019 | License: MIT | Module:


Package Files


const (

	// CharAlphaNum is the class of alpha-numeric characters
	CharAlphaNum = digits + upper + lower
	// CharAll is the class of all characters
	CharAll = digits + upper + lower + syms

func GeneratePassword

func GeneratePassword(length int, symbols bool) string

GeneratePassword generates a random, hard to remember password

func GeneratePasswordCharset

func GeneratePasswordCharset(length int, chars string) string

GeneratePasswordCharset generates a random password from a given set of characters

func GeneratePasswordCharsetCheck

func GeneratePasswordCharsetCheck(length int, chars string) string

GeneratePasswordCharsetCheck generates a random password from a given set of characters and validates the generated password with crunchy

func GeneratePasswordWithAllClasses

func GeneratePasswordWithAllClasses(length int) (string, error)

GeneratePasswordWithAllClasses tries to enforce a password which contains all character classes instead of only enabling them. This is especially useful for broken (corporate) password policies that mandate the use of certain character classes for not good reason

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier