Documentation ¶
Overview ¶
Package entropy provides a means to compute entropy of a given random string by analyzing both the charsets used and its length.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrPasswordInvalid = errors.New("invalid password")
)
A valid password is impossible with the given constraints.
Functions ¶
func Entropy ¶
Entropy computes the number of entropy bits in the given password, assumingly it was randomly generated.
func FromCharsets ¶
func FromCharsets(charsetsUsed charsets.CharsetCollection, length int) (float64, error)
FromCharsets computes the number of entropy bits in a string with the given length that utilizes at least one character from each of the given charsets. It does not perform any subsetting/de-duplication upon the given charsets; they are just used as-is.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.