passing filters

This commit is contained in:
Maciej Długoszek 2017-11-02 14:33:00 +01:00
parent cb069df45f
commit b5a8b8407d
1 changed files with 5 additions and 3 deletions

View File

@ -1,15 +1,17 @@
package zxcvbn package zxcvbn
import ( import (
"time"
"github.com/TheMacies/zxcvbn-go/match"
"github.com/nbutton23/zxcvbn-go/matching" "github.com/nbutton23/zxcvbn-go/matching"
"github.com/nbutton23/zxcvbn-go/scoring" "github.com/nbutton23/zxcvbn-go/scoring"
"github.com/nbutton23/zxcvbn-go/utils/math" "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() start := time.Now()
matches := matching.Omnimatch(password, userInputs) matches := matching.Omnimatch(password, userInputs, filters...)
result := scoring.MinimumEntropyMatchSequence(password, matches) result := scoring.MinimumEntropyMatchSequence(password, matches)
end := time.Now() end := time.Now()