mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #9826 from agnivade/hexencoding
Use hex.EncodeToString to encode to hex
This commit is contained in:
commit
56fe1308ce
@ -8,7 +8,6 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"hash"
|
||||
"strings"
|
||||
)
|
||||
@ -30,7 +29,7 @@ func GetRandomString(n int, alphabets ...byte) string {
|
||||
|
||||
func EncodePassword(password string, salt string) string {
|
||||
newPasswd := PBKDF2([]byte(password), []byte(salt), 10000, 50, sha256.New)
|
||||
return fmt.Sprintf("%x", newPasswd)
|
||||
return hex.EncodeToString(newPasswd)
|
||||
}
|
||||
|
||||
// Encode string to md5 hex value.
|
||||
|
Loading…
Reference in New Issue
Block a user