Initial commit.
This commit is contained in:
14
password.go
Normal file
14
password.go
Normal file
@ -0,0 +1,14 @@
|
||||
package complexity
|
||||
|
||||
// log2(10year × (1trillion/s))
|
||||
const passwordMinEntropy = 68.096549
|
||||
|
||||
func StrongPasswordBytes(password []byte) bool {
|
||||
entropy, _ := Bytes(password)
|
||||
return entropy > passwordMinEntropy
|
||||
}
|
||||
|
||||
func StrongPassword(password string) bool {
|
||||
entropy, _ := String(password)
|
||||
return entropy > passwordMinEntropy
|
||||
}
|
Reference in New Issue
Block a user