https://github.com/marcoshuck/password
Password validation package
https://github.com/marcoshuck/password
Last synced: about 1 month ago
JSON representation
Password validation package
- Host: GitHub
- URL: https://github.com/marcoshuck/password
- Owner: marcoshuck
- License: apache-2.0
- Created: 2023-01-14T23:48:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-25T01:21:50.000Z (over 2 years ago)
- Last Synced: 2025-02-05T06:43:47.637Z (3 months ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Password
Password is a password validation package written in Go used for validating passwords in the backend## Getting started
```shell
go get github.com/marcoshuck/password
```## Usage
```go
err := password.Validate("%+f9mi4#S,o02exo^MC=zkcrkOpf12VMUAXjP+8LBSICO.{vJO")if err != nil {
log.Println("Failed to validate password:", err)
}
```Play with this package in this [Playground](https://go.dev/play/p/zAhLEuKnmZ1) link.
## Benchmark
```
goos: windows
goarch: amd64
pkg: github.com/marcoshuck/password/v1
cpu: AMD Ryzen 5 5600X 6-Core Processor
BenchmarkValidatePassword
BenchmarkValidatePassword-12 2634285 457.5 ns/op
PASS
``````
goos: linux
goarch: amd64
pkg: github.com/marcoshuck/password
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkValidatePassword
BenchmarkValidatePassword-16 2040268 597.4 ns/op
PASS
```