Documentation ¶
Overview ¶
Package passgen generates random passwords.
Example usage:
p := passgen.New() // p is "6NX(W`GD]4:Tqk};Y@A-"
Logic originally from dchest's uniuri library: https://github.com/dchest/uniuri
Functions read from crypto/rand random source, and panic if they fail to read from it.
Index ¶
Constants ¶
const DefLen = 20
DefLen is the default password length returned.
Variables ¶
var DefChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()- _=+,.?/:;{}[]`~")
DefChars is the default set of characters used in the password.
Functions ¶
func New ¶
func New() string
New returns a random, unmemorable password of the default length with the default set of characters.
func NewLen ¶
NewLen returns a random, unmemorable password of the given length with the default set of characters.
func NewLenChars ¶
NewLenChars returns a random, unmemorable password of the given length with the given set of characters.
func NewWordish ¶ added in v1.1.0
func NewWordish() string
NewWordish generates a password made of word-like words.
Types ¶
This section is empty.