Library for easy hashing passwords in Golang https://salifm.github.io/hasher
Go to file
Salif Mehmed ddfa5b168c
add tests
2020-05-11 20:52:59 +03:00
cmd/hasher add cmd 2020-05-11 00:30:25 +03:00
.gitignore Initial commit 2020-05-10 21:05:10 +03:00
go.mod add tests 2020-05-11 20:52:59 +03:00
go.sum add tests 2020-05-11 20:52:59 +03:00
hasher_test.go add tests 2020-05-11 20:52:59 +03:00
hasher.go add tests 2020-05-11 20:52:59 +03:00
LICENSE Initial commit 2020-05-10 21:05:10 +03:00
README.md add tests 2020-05-11 20:52:59 +03:00

hasher

Library for easy hashing and verifying passwords.

Hashing algorithm is Argon2id.

The parameters are:

  • Memory: 65536 B
  • Iterations: 1
  • Parallelism: 4
  • Salt length: 16

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