v0.0.374 ppwgen
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m47s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m47s
This commit is contained in:
35
cryptext/pronouncablePassword_test.go
Normal file
35
cryptext/pronouncablePassword_test.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package cryptext
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPronouncablePasswordExt(t *testing.T) {
|
||||
for i := 0; i < 20; i++ {
|
||||
pw, entropy := PronouncablePasswordExt(rand.New(rand.NewSource(int64(i))), 16)
|
||||
fmt.Printf("[%.2f] => %s\n", entropy, pw)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPronouncablePasswordSeeded(t *testing.T) {
|
||||
for i := 0; i < 20; i++ {
|
||||
pw := PronouncablePasswordSeeded(int64(i), 8)
|
||||
fmt.Printf("%s\n", pw)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPronouncablePassword(t *testing.T) {
|
||||
for i := 0; i < 20; i++ {
|
||||
pw := PronouncablePassword(i + 1)
|
||||
fmt.Printf("%s\n", pw)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPronouncablePasswordWrongLen(t *testing.T) {
|
||||
PronouncablePassword(0)
|
||||
PronouncablePassword(-1)
|
||||
PronouncablePassword(-2)
|
||||
PronouncablePassword(-3)
|
||||
}
|
Reference in New Issue
Block a user