Commit 56fe1308 by Carl Bergquist Committed by GitHub

Merge pull request #9826 from agnivade/hexencoding

Use hex.EncodeToString to encode to hex
parents d4e8e22f 143b56b5
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt"
"hash" "hash"
"strings" "strings"
) )
...@@ -30,7 +29,7 @@ func GetRandomString(n int, alphabets ...byte) string { ...@@ -30,7 +29,7 @@ func GetRandomString(n int, alphabets ...byte) string {
func EncodePassword(password string, salt string) string { func EncodePassword(password string, salt string) string {
newPasswd := PBKDF2([]byte(password), []byte(salt), 10000, 50, sha256.New) 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. // Encode string to md5 hex value.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment