go format + make testapp take input
This commit is contained in:
parent
be3c235ccd
commit
fbd806564e
|
@ -6,11 +6,13 @@ import (
|
|||
|
||||
"github.com/nbutton23/zxcvbn-go/data"
|
||||
)
|
||||
|
||||
// List holds a frequency list
|
||||
type List struct {
|
||||
Name string
|
||||
List []string
|
||||
}
|
||||
|
||||
// Lists holds all the frequency list in a map
|
||||
var Lists = make(map[string]List)
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package matching
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"regexp"
|
||||
|
||||
"github.com/nbutton23/zxcvbn-go/entropy"
|
||||
"github.com/nbutton23/zxcvbn-go/match"
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/nbutton23/zxcvbn-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
password := "Testaaatyhg890l33t"
|
||||
|
||||
fmt.Println("Enter password:")
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
password, _ := reader.ReadString('\n')
|
||||
//password := "Testaaatyhg890l33t"
|
||||
|
||||
passwordStenght := zxcvbn.PasswordStrength(password, nil)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package zxcvbn
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,6 @@ func TestPasswordStrength(t *testing.T) {
|
|||
|
||||
var formatString = "%s : error should be less than %.2f Acctual error: %.4f Expected entropy %.4f Actual entropy %.4f \n"
|
||||
|
||||
|
||||
func runTest(t *testing.T, password string, pythonEntropy float64) {
|
||||
|
||||
goEntropy := GoPasswordStrength(password, nil)
|
||||
|
|
Loading…
Reference in New Issue