Files
complexity/password.go
2025-08-13 12:17:25 -04:00

15 lines
326 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package complexity
// log2(10year × (1trillion/s))
const passwordMinEntropy = 68.096549
func StrongPasswordBytes(password []byte) bool {
entropy, _ := Bytes(password)
return entropy > passwordMinEntropy
}
func StrongPassword(password string) bool {
entropy, _ := String(password)
return entropy > passwordMinEntropy
}