2022-12-04 02:18:05 +01:00
|
|
|
# Argon2 utils
|
|
|
|
|
|
|
|
## About
|
|
|
|
|
|
|
|
Utils to encrypt passwords using argon2
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Example
|
|
|
|
|
|
|
|
````go
|
|
|
|
func func main() {
|
|
|
|
password := 'qwerty@123'
|
|
|
|
hashedString, err := argon2_utils.HashStringArgon2(password)
|
|
|
|
if err != nil {
|
|
|
|
...
|
|
|
|
}
|
2022-12-24 17:52:32 +01:00
|
|
|
match, err := argon2_utils.CompareStringToArgon2Hash(password, hashedString)
|
2022-12-04 02:18:05 +01:00
|
|
|
if err != nil {
|
|
|
|
...
|
|
|
|
}
|
|
|
|
if !match {
|
|
|
|
log.Println("passwords don't match")
|
|
|
|
} else {
|
|
|
|
log.Println("passwords match")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
````
|
|
|
|
|
|
|
|
This package also contains a **RandomString(int)(string,error)** function.
|
|
|
|
|
|
|
|
## Contributions
|
|
|
|
|
2022-12-04 02:36:16 +01:00
|
|
|
**Euphoria Laxis** [GitHub](https://github.com/euphoria-laxis)
|
2022-12-04 02:18:05 +01:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is under [MIT License](./LICENSE)
|