Documentation ¶
Overview ¶
Package pwgen allows generating random passwords given charsets, length limits, and target entropy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidLenBounds = errors.New("bad length bounds")
ErrInvalidLenBounds represents bad minLen/maxLen values.
Functions ¶
func GenPW ¶
GenPW generates a random password using characters from the charsets enumerated by charsetsEnumerated. At least one element of each charset is used. Available charsets are "lowercase", "uppercase", "numbers", "symbols", "latin1", latinExtendedA", "latinExtendedB", and "ipaExtensions". "latin" is also available: it's equivalent to specifying "latin1 latinExtendedA latinExtendedB ipaExtensions". Anything else will be treated as a string containing runes of a new custom charset to use. If entropyWanted is 0, the generated password has at least 256 bits of entropy; otherwise, it has entropyWanted bits of entropy. minLen and maxLen are ignored when set to zero; otherwise, they set lower/upper bounds on password character count and override entropyWanted if necessary.
Types ¶
This section is empty.