From b5a8b8407d8215c6b3ebfa8db913e3f7620905c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20D=C5=82ugoszek?= Date: Thu, 2 Nov 2017 14:33:00 +0100 Subject: [PATCH] passing filters --- zxcvbn.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zxcvbn.go b/zxcvbn.go index 510fe96..22a1345 100644 --- a/zxcvbn.go +++ b/zxcvbn.go @@ -1,15 +1,17 @@ package zxcvbn import ( + "time" + + "github.com/TheMacies/zxcvbn-go/match" "github.com/nbutton23/zxcvbn-go/matching" "github.com/nbutton23/zxcvbn-go/scoring" "github.com/nbutton23/zxcvbn-go/utils/math" - "time" ) -func PasswordStrength(password string, userInputs []string) scoring.MinEntropyMatch { +func PasswordStrength(password string, userInputs []string, filters ...func(match.Matcher) bool) scoring.MinEntropyMatch { start := time.Now() - matches := matching.Omnimatch(password, userInputs) + matches := matching.Omnimatch(password, userInputs, filters...) result := scoring.MinimumEntropyMatchSequence(password, matches) end := time.Now()