Responsible to measure password strength using entropy value.
Example:
package main
import (
"fmt"
"log"
"os"
"github.com/steveanlorn/pwdentropy"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "password is required")
os.Exit(2)
}
for _, password := range os.Args[1:] {
entropy := pwdentropy.Calculate(password)
log.Printf("Entropy %s: %.2f\n", password, entropy)
}
}
You can refer to that table above for the entropy threshold value.