feat: first init
This commit is contained in:
18
password/password.go
Normal file
18
password/password.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package password
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Check checks if password is valid, and returns message, and if its a strong password
|
||||
func Check(input string, wordList, passwordList []string) (string, error) {
|
||||
// Check if password is shorter than 8 characters
|
||||
if len(input) < 8 {
|
||||
return "Weak password", fmt.Errorf("password cannot be shorter than 8 characters")
|
||||
}
|
||||
|
||||
// Check if password contains a number and a special character
|
||||
for _, letter := range input {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user