mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Fix regression in integration page and simplify SQL query
This commit is contained in:
parent
309e6d1084
commit
7988241e11
4 changed files with 72 additions and 174 deletions
|
@ -9,6 +9,8 @@ import (
|
|||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
// HashFromBytes returns a SHA-256 checksum of the input.
|
||||
|
@ -41,3 +43,8 @@ func GenerateRandomString(size int) string {
|
|||
func GenerateRandomStringHex(size int) string {
|
||||
return hex.EncodeToString(GenerateRandomBytes(size))
|
||||
}
|
||||
|
||||
func HashPassword(password string) (string, error) {
|
||||
bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
|
||||
return string(bytes), err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue