Library for easy hashing passwords in Golang
https://salifm.github.io/hasher
f2721dcd7c | ||
---|---|---|
cmd/hasher | ||
.gitignore | ||
go.mod | ||
go.sum | ||
hasher_test.go | ||
hasher.go | ||
LICENSE | ||
README.md |
hasher
Library for easy hashing and verifying passwords.
Hashing algorithm is Argon2id.
The parameters are:
- Memory: 65536 B
- Iterations: 1
- Parallelism: 4
- Salt length: 32
Usage
Import
import (
"github.com/salifm/hasher"
)
Hash
var password string = "password"
hash, salt, err := hasher.Hash(password)
// save hash and salt to database
Verify
var password string = "password"
// get hash and salt from database
match, err := hasher.Verify(password, hash, salt)
if match {
// The password is correct
}
License
This library is licensed under the MIT license