Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bounoable/strongword

Simple utility library for password strength validation.
https://github.com/bounoable/strongword

go golang password strength validation

Last synced: about 5 hours ago
JSON representation

Simple utility library for password strength validation.

Awesome Lists containing this project

README

        

# strongword - Password strength validator for GO



GoDoc

Version

License: MIT

Simple utility library to validate password strengths against a set of rules.

## Install

```sh
go get github.com/bounoable/strongword
```

## Usage

### Default rule set

```go
import "github.com/bounoable/strongword"

errs := strongword.Validate("weakpassword")

for _, err := range errs {
fmt.Println(err)
}
```

### Custom rule set

```go
import "github.com/bounoable/strongword"

errs := strongword.Validate(
"weakpassword",
strongword.MinLength(12),
strongword.SpecialChars(3),
strongword.Regexp(regexp.MustCompile("(?)[0-9]{4}"))
)

for _, err := range errs {
fmt.Println(err)
}
```